<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ABCoder &#187; JavaScript</title>
	<atom:link href="http://abcoder.com/topics/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://abcoder.com</link>
	<description>ABCoder - Coding is Simple as A b c</description>
	<lastBuildDate>Sat, 17 Jul 2010 11:45:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>jQuery Mix Photo Gallery</title>
		<link>http://abcoder.com/javascript/jquery/jquery-mix-photo-gallery/</link>
		<comments>http://abcoder.com/javascript/jquery/jquery-mix-photo-gallery/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 06:50:38 +0000</pubDate>
		<dc:creator>rahen</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[album]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mix]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=668</guid>
		<description><![CDATA[jQuery Mix Photo Gallery - my own-coded unique photo gallery. It is very interesting and eye-pleasant, free to download and use.


Related posts:<ol><li><a href='http://abcoder.com/javascript/jquery/jquery-drop-down-menu-without-settimeout/' rel='bookmark' title='Permanent Link: jQuery Drop down menu without setTimeout'>jQuery Drop down menu without setTimeout</a> <small>jQuery drop down menu without using setTimeout function of javascript. It uses the magic of jQuery's hover function. The magical thing happens when the hover function is called inside another hover function with first function to null. So the menu doesn't hide and so no need to use the setTimeout. It's a very smart solution in the "jQuery way"!...</small></li>
<li><a href='http://abcoder.com/javascript/jquery-manual-in-chm-format/' rel='bookmark' title='Permanent Link: jQuery Manual in .chm format (Update: version 1.4.2)'>jQuery Manual in .chm format (Update: version 1.4.2)</a> <small>Download jQuery Manual in a single .chm file for Free! Update: version 1.4.2 .air and html...</small></li>
<li><a href='http://abcoder.com/javascript/jquery/advanced-cycle-plugin-integration/' rel='bookmark' title='Permanent Link: Advanced cycle plugin integration'>Advanced cycle plugin integration</a> <small>Load only the current slide of a jQuery cycle plugin slideshow. For large size images slideshow, loading all the images at once highly affects the page loading time. Here is the technique to load one image once only before starting of the next slide. It'll definitely reduce the page loading time....</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Recently I coded an interesting photo gallery using jQuery. I&#8217;ve named it &#8220;jQuery Mix Photo Gallery&#8221;. I&#8217;ve included the screen-shots here.</p>
<p><img src="http://abcoder.com/wp-content/uploads/2010/07/jQuery-Mix-Photo-Gallery_1.png" alt="" title="jQuery-Mix-Photo-Gallery_1" width="430" height="282" class="alignnone size-full wp-image-669" /></p>
<p><img src="http://abcoder.com/wp-content/uploads/2010/07/jQuery-Mix-Photo-Gallery_2.png" alt="" title="jQuery-Mix-Photo-Gallery_2" width="430" height="282" class="alignnone size-full wp-image-670" /></p>
<p>You may have a look at the live demo <a href="http://abcoder.com/jquery_mix_photo_gallery/" target="_blank">here</a>. The photo gallery is free to download. Here is the <a href="http://abcoder.com/jquery_mix_photo_gallery.zip" target="_blank">download link</a>. You may modify it according to your need and use it in your commercial projects. Please drop a comment if you like it and suggest me how can I make it much better.</p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/jquery/jquery-drop-down-menu-without-settimeout/' rel='bookmark' title='Permanent Link: jQuery Drop down menu without setTimeout'>jQuery Drop down menu without setTimeout</a> <small>jQuery drop down menu without using setTimeout function of javascript. It uses the magic of jQuery's hover function. The magical thing happens when the hover function is called inside another hover function with first function to null. So the menu doesn't hide and so no need to use the setTimeout. It's a very smart solution in the "jQuery way"!...</small></li>
<li><a href='http://abcoder.com/javascript/jquery-manual-in-chm-format/' rel='bookmark' title='Permanent Link: jQuery Manual in .chm format (Update: version 1.4.2)'>jQuery Manual in .chm format (Update: version 1.4.2)</a> <small>Download jQuery Manual in a single .chm file for Free! Update: version 1.4.2 .air and html...</small></li>
<li><a href='http://abcoder.com/javascript/jquery/advanced-cycle-plugin-integration/' rel='bookmark' title='Permanent Link: Advanced cycle plugin integration'>Advanced cycle plugin integration</a> <small>Load only the current slide of a jQuery cycle plugin slideshow. For large size images slideshow, loading all the images at once highly affects the page loading time. Here is the technique to load one image once only before starting of the next slide. It'll definitely reduce the page loading time....</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/jquery/jquery-mix-photo-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSONP First Timer</title>
		<link>http://abcoder.com/javascript/jquery/jsonp-first-timer/</link>
		<comments>http://abcoder.com/javascript/jquery/jsonp-first-timer/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 15:36:28 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[critical]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[getJSON]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[json_encode]]></category>
		<category><![CDATA[JSONP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[tough]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=643</guid>
		<description><![CDATA[Ajax is one-man's-girl, no way to make it work cross-domain, but there is always a way around for every problem...


Related posts:<ol><li><a href='http://abcoder.com/javascript/core_javascript/javascript_timer/' rel='bookmark' title='Permanent Link: Javascript timer &#8211; advanced features, simple to use'>Javascript timer &#8211; advanced features, simple to use</a> <small>javascript is the core of rich UI development and ajax driven website. i enjoy doing these. but in many cases, i thought things would be easier if the setTimeout(&#8230;) or setInterval(&#8230;) functions were simpler to handle. if you ever tried to make something like fadeout effect or accordion or anything that happens with a certain [...]...</small></li>
<li><a href='http://abcoder.com/javascript/ie6-png-alpha-transparency-fix-for-dynamically-loaded-images-via-ajax/' rel='bookmark' title='Permanent Link: IE6 png alpha transparency fix for dynamically loaded images via ajax'>IE6 png alpha transparency fix for dynamically loaded images via ajax</a> <small>Simple javascript and jQuery code for fixing the alpha transparency problem of png image on Internet explorer 6. iepngfix.htc does not work for dynamic images loaded via ajax call. But this simple code works great for dynamically loaded images....</small></li>
<li><a href='http://abcoder.com/javascript/how-to-get-currently-logged-on-windows-username-in-php-javascript/' rel='bookmark' title='Permanent Link: How to get currently logged on windows username in PHP and Javascript'>How to get currently logged on windows username in PHP and Javascript</a> <small>Get current windows username in php and javascript! Is that possible?...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>You already know ajax is one-man&#8217;s-girl, no way to make it work cross-domain(not even subdomain) due to browsers&#8217; <em>same origin policy</em> security restriction. But using ajax is so sleek, you can&#8217;t even resist yourself using it under different domains. There is always a way around for everything. Do I sound contradictory? Ajax is based on the XMLHttpRequest and as long as we use it we can&#8217;t do cross-domain data transfer. Let&#8217;s think something else other than ajax.</p>
<p>We are used to loading images, css, javascript files from other domains and it&#8217;s okay if we use any server-side dynamic link as the src, this is a common phenomena on web. For example:</p>
<pre class="brush: xml; gutter: false;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.other-domain.com/dynamic-js.php?id=5&amp;name=Matt&quot;&gt;&lt;/script&gt;</pre>
<p>There is no security restriction including javascript source from different domains, and fortunately enough you can pass GET variables (don&#8217;t over-expect for POST) with the url. This is how JSONP (JSON with padding) works, thanks to the <em>open policy</em> for &lt;script&gt; tag. May be you&#8217;r already thinking how to implement this idea, hold on! you don&#8217;t need to reinvent the wheel.</p>
<p>Here comes jQuery&#8217;s $.getJSON(), with this function you can pass url of another domain and get JSON data. Lemme warn you, for the very first time most of you won&#8217;t be able to make it work. Here is an example:</p>
<pre class="brush: jscript;">$.getJSON(&quot;http://www.other-domain.com/dynamic-js.php?id=5&amp;name=Matt&amp;jsoncallback=?&quot;,
function(data){
    // your code goes here
});</pre>
<p>You need to understand this &#8220;jsoncallback=?&#8221; bit clearly. From your firebug <strong>Net</strong> panel you can see the &#8220;?&#8221; is replaced with &#8220;jsonp1277557614558&#8243; (random value on each request).</p>
<p><img src="http://abcoder.com/wp-content/uploads/2010/06/JSONP.png" alt="JSONP Net Panel screen shot" title="JSONP" width="430" height="145" class="alignnone size-full wp-image-646" /></p>
<p>The common mistake you&#8217;re gonna do is you expect to see something on firebug&#8217;s Console tab, but nothing there, once again <strong>JSONP is NOT Ajax request</strong>. This is merely an external javascript file being added to your document dynamically, if you don&#8217;t believe me on your firebug panel click the <strong>JS</strong> from Net tab to filter out the JS only(marked in the screen-shot above). You&#8217;ll definitely see the JSONP url there. This is the client-side part of $.getJSON(). The confusion still remains with the server-side code.</p>
<p>Back to &#8220;http://www.other-domain.com/dynamic-js.php?id=5&amp;name=Matt&amp;jsoncallback=?&#8221;, the file being called is dynamic-js.php. Put this one line of code in that file:</p>
<pre class="brush: php; gutter: false;">&lt;?php print_r($_GET); ?&gt;</pre>
<p>And check the Response output from firebug&#8217;s Net tab. It&#8217;ll be something like:</p>
<pre class="brush: php; gutter: false;">Array
(
    [id] =&gt; 5
    [name] =&gt; Matt
    [jsoncallback] =&gt; jsonp1277557614558
)</pre>
<p>In Ajax when the dataType is json the response from server-side script is just the json string:</p>
<pre class="brush: php; gutter: false;">{
	// your json data
}</pre>
<p>Here is the most important part, unlike ajax for JSONP the $.getJSON() expects the response like:</p>
<pre class="brush: php; gutter: false;"> jsonp1277557614558({
	// your json data here
})</pre>
<p>So you must wrap the json output with jsonp1277557614558( ). If you don&#8217;t do it the callback will fail silently without any error, which makes it tough to detect the exact problem. Remember the jsonp1277557614558 is a random string. For php the code will be something like this:</p>
<pre class="brush: php;">&lt;?php
// your code here
// get the output in an array say $output_array
$jc = $_GET['jsoncallback'];
echo $jc . '(' . json_encode($output_array) . ')';
/*
// For ajax response, simply
echo json_encode($output_array);
// is enough
*/
?&gt;</pre>
<p>This is the most crucial thing, most programmers do the mistake for their very first time as there is no clear elaboration on <a href="http://api.jquery.com/jQuery.getJSON/" target="_blank" title="jQuery.getJSON() - jQuery API">$.getJSON documentation page</a>. FYI, json_encode() function is not available on older version of php. You can get the php class from <a href="http://www.json.org/" target="_blank" title="JSON">json.org</a>.</p>
<p>Hope your $.getJSON() is now working! :)</p>
<p>Comments, criticism are most welcome.</p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/core_javascript/javascript_timer/' rel='bookmark' title='Permanent Link: Javascript timer &#8211; advanced features, simple to use'>Javascript timer &#8211; advanced features, simple to use</a> <small>javascript is the core of rich UI development and ajax driven website. i enjoy doing these. but in many cases, i thought things would be easier if the setTimeout(&#8230;) or setInterval(&#8230;) functions were simpler to handle. if you ever tried to make something like fadeout effect or accordion or anything that happens with a certain [...]...</small></li>
<li><a href='http://abcoder.com/javascript/ie6-png-alpha-transparency-fix-for-dynamically-loaded-images-via-ajax/' rel='bookmark' title='Permanent Link: IE6 png alpha transparency fix for dynamically loaded images via ajax'>IE6 png alpha transparency fix for dynamically loaded images via ajax</a> <small>Simple javascript and jQuery code for fixing the alpha transparency problem of png image on Internet explorer 6. iepngfix.htc does not work for dynamic images loaded via ajax call. But this simple code works great for dynamically loaded images....</small></li>
<li><a href='http://abcoder.com/javascript/how-to-get-currently-logged-on-windows-username-in-php-javascript/' rel='bookmark' title='Permanent Link: How to get currently logged on windows username in PHP and Javascript'>How to get currently logged on windows username in PHP and Javascript</a> <small>Get current windows username in php and javascript! Is that possible?...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/jquery/jsonp-first-timer/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>jQuery Drop down menu without setTimeout</title>
		<link>http://abcoder.com/javascript/jquery/jquery-drop-down-menu-without-settimeout/</link>
		<comments>http://abcoder.com/javascript/jquery/jquery-drop-down-menu-without-settimeout/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 04:26:46 +0000</pubDate>
		<dc:creator>rahen</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[dd menu]]></category>
		<category><![CDATA[delay]]></category>
		<category><![CDATA[drop-down]]></category>
		<category><![CDATA[dropdown]]></category>
		<category><![CDATA[exceptional]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[setTimeout]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[uncommon]]></category>
		<category><![CDATA[unique]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=282</guid>
		<description><![CDATA[jQuery drop down menu without using setTimeout function of javascript. It uses the magic of jQuery's hover function. The magical thing happens when the hover function is called inside another hover function with first function to null. So the menu doesn't hide and so no need to use the setTimeout. It's a very smart solution in the "jQuery way"!


Related posts:<ol><li><a href='http://abcoder.com/javascript/ie6-fix-for-select-box-over-absolute-positioned-element/' rel='bookmark' title='Permanent Link: IE6 fix for select box over absolute positioned element'>IE6 fix for select box over absolute positioned element</a> <small>The detailed instruction with css and jquery code for drop down menu over select box - fix for ie6....</small></li>
<li><a href='http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/' rel='bookmark' title='Permanent Link: Gmail uploader clone with drag drop feature : Free Download with source code'>Gmail uploader clone with drag drop feature : Free Download with source code</a> <small>Gmail file uploader clone with drag drop feature using jQuery. Download full working source code in a single zip file for free....</small></li>
<li><a href='http://abcoder.com/javascript/jquery/jquery-mix-photo-gallery/' rel='bookmark' title='Permanent Link: jQuery Mix Photo Gallery'>jQuery Mix Photo Gallery</a> <small>jQuery Mix Photo Gallery - my own-coded unique photo gallery. It is very interesting and eye-pleasant, free to download and use....</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I worked a lot with drop-down menus like most of you. There are many stable versions of DD menus using pure javascript &#038; CSS or only CSS with cross-browser support and you&#8217;ll get them free from many menu maker websites or desktop applications. So I&#8217;m not going to reinvent the wheel.</p>
<p>I&#8217;m a freaking fan of jQuery and always use it for drop-down menus with my custom jQuery code. It&#8217;s a must to use a delay for javascript driven dd menus even for jQuery when you want to give it some effect like slideDown or slideUp (For CSS dropdown menus it&#8217;s not possible &#038; thus no need to use delay). I always wished to use jQuery without any setTimeout function for the drop-down menus. And I did it which I&#8217;m gonna share with you.</p>
<pre class="brush: jscript;">$(function () {
    $(&quot;ul&gt;li&quot;).hover(function () {
        $(this).find(&quot;ul.sub&quot;).slideDown('fast');
        $(this).addClass(&quot;hover&quot;);
        $(this).hover(
        function () {},
        function () {
            $(this).find(&quot;ul.sub&quot;).slideUp('fast');
        });
    },
    function () {
        $(this).removeClass(&quot;hover&quot;);
    })
})</pre>
<p><a href="http://abcoder.com/menu-simple.html" title="Drop down menu using jQuery without setTimeout" target="_blank">Here it is in action</a></p>
<p>The main tricky part is using hover inside hover function:</p>
<pre class="brush: jscript;">$(this).hover(
function () {},
function () {
    $(this).find(&quot;ul.sub&quot;).slideUp('fast');
});</pre>
<p>This removes the mouseover function (first function of hover) when mouse hover into the li so the slideDown does not happen again when the mouse enter into the inner ul/li. Hope that makes sense. You may like to add a delay and do some more fine tunes.</p>
<p>Happy Coding!</p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/ie6-fix-for-select-box-over-absolute-positioned-element/' rel='bookmark' title='Permanent Link: IE6 fix for select box over absolute positioned element'>IE6 fix for select box over absolute positioned element</a> <small>The detailed instruction with css and jquery code for drop down menu over select box - fix for ie6....</small></li>
<li><a href='http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/' rel='bookmark' title='Permanent Link: Gmail uploader clone with drag drop feature : Free Download with source code'>Gmail uploader clone with drag drop feature : Free Download with source code</a> <small>Gmail file uploader clone with drag drop feature using jQuery. Download full working source code in a single zip file for free....</small></li>
<li><a href='http://abcoder.com/javascript/jquery/jquery-mix-photo-gallery/' rel='bookmark' title='Permanent Link: jQuery Mix Photo Gallery'>jQuery Mix Photo Gallery</a> <small>jQuery Mix Photo Gallery - my own-coded unique photo gallery. It is very interesting and eye-pleasant, free to download and use....</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/jquery/jquery-drop-down-menu-without-settimeout/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Advanced cycle plugin integration</title>
		<link>http://abcoder.com/javascript/jquery/advanced-cycle-plugin-integration/</link>
		<comments>http://abcoder.com/javascript/jquery/advanced-cycle-plugin-integration/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 20:32:40 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[cycle]]></category>
		<category><![CDATA[efficient]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[loading time]]></category>
		<category><![CDATA[onBefore]]></category>
		<category><![CDATA[once]]></category>
		<category><![CDATA[one]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[preload]]></category>
		<category><![CDATA[reduce page loading time]]></category>
		<category><![CDATA[slide]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[slow]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=144</guid>
		<description><![CDATA[Load only the current slide of a jQuery cycle plugin slideshow. For large size images slideshow, loading all the images at once highly affects the page loading time. Here is the technique to load one image once only before starting of the next slide. It'll definitely reduce the page loading time.


Related posts:<ol><li><a href='http://abcoder.com/javascript/jquery/jquery-cycle-plugin-as-carousel/' rel='bookmark' title='Permanent Link: jQuery cycle plugin as carousel'>jQuery cycle plugin as carousel</a> <small>You can use the jQuery cycle plugin as carousel. No need of special plugin for carousel. Just use the fx: 'scrollHorz' and that's all! This option is kinda hidden on the malsup site. Don't know why they never emphasize on this option!!...</small></li>
<li><a href='http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/' rel='bookmark' title='Permanent Link: Gmail uploader clone with drag drop feature : Free Download with source code'>Gmail uploader clone with drag drop feature : Free Download with source code</a> <small>Gmail file uploader clone with drag drop feature using jQuery. Download full working source code in a single zip file for free....</small></li>
<li><a href='http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/' rel='bookmark' title='Permanent Link: Using Dreamweaver Spry validation with jQuery ajax form plugin'>Using Dreamweaver Spry validation with jQuery ajax form plugin</a> <small>A simple function for using Spry form validation of Dreamweaver with jQuery ajax form submit plugin. Just put this 3 lines of code in the "beforeSubmit" parameter of $.ajaxForm and that's all!...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>On my <a href="http://abcoder.com/javascript/jquery/jquery-cycle-plugin-as-carousel/">another post</a> I mentioned that cycle is a great jQuery plugin. I use it very often for slideshow. Recently I used it on a project where the slideshow had many(20+) wallpaper sized images. So loading time was a great issue.</p>
<p>The default cycle integration includes all the images during page loading which is okay for small images, but highly affects the page loading time for high resolution images. cycle plugin is highly flexible! I fixed the issue by loading images dynamically one after another at the end of each slide, literally before the beginning of each slide.</p>
<p>Here is how I did it:</p>
<pre class="brush: xml;">&lt;div id=&quot;slideshow&quot;&gt;&lt;!-- slides will be added here --&gt;&lt;/div&gt;</pre>
<pre class="brush: jscript;">var gallery = [&quot;images/1.jpg&quot;, &quot;images/2.jpg&quot;, &quot;images/3.jpg&quot;, &quot;images/4.jpg&quot;, &quot;images/5.jpg&quot;, &quot;images/6.jpg&quot;, &quot;images/7.jpg&quot;, &quot;images/8.jpg&quot;, &quot;images/9.jpg&quot;, &quot;images/10.jpg&quot;, &quot;images/11.jpg&quot;, &quot;images/12.jpg&quot;, &quot;images/13.jpg&quot;, &quot;images/14.jpg&quot;]; // and so on.. array of images
// Array clone function.
Array.prototype.clone = function () {
    var arr = new Array();
    for (var property in this) {
        arr[property] = typeof(this[property]) == 'object' ? this[property].clone() : this[property];
    }
    return arr;
}
var gal = null; // gal should be global as I'll use it inside onBefore function
$(function () {
    gal = gallery.clone(); // cloning the array is not mandatory, but doing so will keep the main array unchanged.
    $('#slideshow').empty().append('&lt;img src=&quot;' + gal.pop() + '&quot; /&gt;&lt;img src=&quot;' + gal.shift() + '&quot; /&gt;&lt;img src=&quot;' + gal.shift() + '&quot; /&gt;') // adding the last, first and second element of the array to the slideshow div, then start the cycle plugin.
    .cycle({
        startingSlide: 1,
        // this is required (1 is the 2nd slide) as the first slide is the last element of the array. if you use manual next/prev button clicking on #prev will show the first element.
        before: onBefore, // loads the next image at the beginning of each slide. (NOT all at once)
        next: &quot;#next&quot;,
        prev: &quot;#prev&quot;
    });
    var totalSlideCount = 1 + gal.length;
    function onBefore(curr, next, opts, fwd){
        // at first addSlide is not defined, so we should return.
	if (!opts.addSlide) return;
	// if all the elements of the array are added no need to add them again!
        if (opts.slideCount == totalSlideCount) return;
	// shift or pop from slide array
        var nextSlideSrc = fwd ? gal.shift() : gal.pop();
	// add next slide
        opts.addSlide('&lt;img src=&quot;' + nextSlideSrc + '&quot; /&gt;', fwd == false);
    }
});</pre>
<p>In this code above, cloning the array is optional. I used it as I needed the main array for later use. Probably you know if you use the global array reference to a local variable and apply pop()/shift()/push() functions to the local variable, the global one will be affected. cos the local variable is just a reference to the address of the global array variable.</p>
<p>At first the last, 1st and 2nd elements of the array are added to the #slideshow div and the cycle is started from the 2nd slide. Before starting of each slide onBefore function is called. The onBefore function adds new slide to the slideshow and stops when all the array elements are added to the slide.</p>
<p>You may use it for small size images also if you need to improve the page loading duration.</p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/jquery/jquery-cycle-plugin-as-carousel/' rel='bookmark' title='Permanent Link: jQuery cycle plugin as carousel'>jQuery cycle plugin as carousel</a> <small>You can use the jQuery cycle plugin as carousel. No need of special plugin for carousel. Just use the fx: 'scrollHorz' and that's all! This option is kinda hidden on the malsup site. Don't know why they never emphasize on this option!!...</small></li>
<li><a href='http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/' rel='bookmark' title='Permanent Link: Gmail uploader clone with drag drop feature : Free Download with source code'>Gmail uploader clone with drag drop feature : Free Download with source code</a> <small>Gmail file uploader clone with drag drop feature using jQuery. Download full working source code in a single zip file for free....</small></li>
<li><a href='http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/' rel='bookmark' title='Permanent Link: Using Dreamweaver Spry validation with jQuery ajax form plugin'>Using Dreamweaver Spry validation with jQuery ajax form plugin</a> <small>A simple function for using Spry form validation of Dreamweaver with jQuery ajax form submit plugin. Just put this 3 lines of code in the "beforeSubmit" parameter of $.ajaxForm and that's all!...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/jquery/advanced-cycle-plugin-integration/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>IE6 fix for select box over absolute positioned element</title>
		<link>http://abcoder.com/javascript/ie6-fix-for-select-box-over-absolute-positioned-element/</link>
		<comments>http://abcoder.com/javascript/ie6-fix-for-select-box-over-absolute-positioned-element/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 11:07:36 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[Core JavaScript]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[absolute]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[drop down menu]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[internet explorer 6]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[ul]]></category>
		<category><![CDATA[windowed element]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=129</guid>
		<description><![CDATA[The detailed instruction with css and jquery code for drop down menu over select box - fix for ie6.


Related posts:<ol><li><a href='http://abcoder.com/javascript/jquery/jquery-drop-down-menu-without-settimeout/' rel='bookmark' title='Permanent Link: jQuery Drop down menu without setTimeout'>jQuery Drop down menu without setTimeout</a> <small>jQuery drop down menu without using setTimeout function of javascript. It uses the magic of jQuery's hover function. The magical thing happens when the hover function is called inside another hover function with first function to null. So the menu doesn't hide and so no need to use the setTimeout. It's a very smart solution in the "jQuery way"!...</small></li>
<li><a href='http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page/' rel='bookmark' title='Permanent Link: A better process to find maximum z-index within a page'>A better process to find maximum z-index within a page</a> <small>A jQuery approach to find the maximum z-index of an element in DOM. You'll find it helpful and handy for your complex javascript application when you need to handle the absolute positioned message windows layers or similar cases....</small></li>
<li><a href='http://abcoder.com/css/css-equal-height-columns/' rel='bookmark' title='Permanent Link: CSS Equal Height Columns'>CSS Equal Height Columns</a> <small>Pure CSS three columns equal height hack with and without background image, bottom border fix and many more. Please go through the full article for different phenomena of div based multi-columns layout with free html, jQuery, javascript, css source code and images....</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>IE6 sux. General css/javascript hover drop-down menu uses a div or ul with position:absolute. No matter how much you increase the value of z-index the select box (windowed element) will always remain on top most &#8211; yes only on a special browser, Internet Explorer 6. The reason is IE6 considers select element as windowed element and keeps it always on top layer. </p>
<p><img src="http://abcoder.com/images/select-box-over-div-ie6.jpg" alt="IE6 select box over div " /></p>
<p>Solution is using iframe on top of select element, as iframe is also a windowed element placing it on top of select box fix the problem.</p>
<p><img src="http://abcoder.com/images/select-box-over-div-ie6-fixed.jpg" alt="IE6 select box over div prob fixed using iframe" /></p>
<p>Here is the typical HTML code for this drop-down menu:</p>
<pre class="brush: xml;">&lt;div class=&quot;top-menus&quot; style=&quot;left: 221px; top: 127px;&quot;&gt;
&lt;iframe frameborder=&quot;0&quot; scrolling=&quot;no&quot; align=&quot;bottom&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; src=&quot;javascript:'';&quot; style=&quot;height: 200px;&quot;&gt;&lt;/iframe&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Bracelets&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Rings&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Earrings&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Necklaces&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;</pre>
<p>The inline css is calculated using jQuery offset() function. FYI, you can easily get the width,height,left,top position of any element using jQuery(&#8220;element&#8221;).offset(). Make sure the width and height of the iframe is exactly same of it&#8217;s overlying UL element. If you apply any border to the UL, you have to consider that during calculating the proper width/height of the iframe.</p>
<p>This is the sample jQuery code:</p>
<pre class="brush: jscript;">var timer = null; // global
$(&quot;#top-nav a&quot;).hover(function(){
	clearTimeout(timer);
	$(&quot;#top-nav a:not('.cur')&quot;).removeClass(&quot;selected&quot;);
	$(this).addClass(&quot;selected&quot;);

	var o = $(this).offset();
	var left = o.left + 1; // 1px extra for border
	var top = o.top + 32; // 32px for placing it just below the horizontal menu
	if($(&quot;.top-menus&quot;).length){
		if(left == $(&quot;.top-menus&quot;).offset().left)
			return;
		else $(&quot;.top-menus&quot;).remove();
	}

	$(&quot;body&quot;).prepend('&lt;div style=&quot;left:'+left+'px;top:'+top+'px;&quot; class=&quot;top-menus&quot;&gt;&lt;iframe src=&quot;javascript:\'\';&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; align=&quot;bottom&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;ul&gt;'+html+'&lt;/ul&gt;&lt;/div&gt;');
		$(&quot;.top-menus&quot;).find(&quot;.parent, .child&quot;).remove();
		var hi = $(&quot;.top-menus&quot;).find(&quot;ul&quot;).height();
		$(&quot;iframe&quot;).height(hi + 2); // extra 2px for border

}, function(){
	clearTimeout(timer);
	timer = setTimeout(function(){$(&quot;body&quot;).find(&quot;iframe,.top-menus&quot;).remove(); $(&quot;#top-nav a:not('.cur')&quot;).removeClass(&quot;selected&quot;);},300);
});

$(&quot;.top-menus&quot;).live(&quot;mouseover&quot;,function(){
	clearTimeout(timer);
}).live(&quot;mouseout&quot;,function(){
	clearTimeout(timer);
	timer = setTimeout(function(){$(&quot;body&quot;).find(&quot;iframe,.top-menus&quot;).remove(); $(&quot;#top-nav a:not('.cur')&quot;).removeClass(&quot;selected&quot;);},300);
});</pre>
<p>I know this code won&#8217;t exactly fulfill your requirement, you can get the main idea from this and write your own code yourself. You can see it in action on <a href="http://www.trendtogo.com/">www.trendtogo.com</a>.</p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/jquery/jquery-drop-down-menu-without-settimeout/' rel='bookmark' title='Permanent Link: jQuery Drop down menu without setTimeout'>jQuery Drop down menu without setTimeout</a> <small>jQuery drop down menu without using setTimeout function of javascript. It uses the magic of jQuery's hover function. The magical thing happens when the hover function is called inside another hover function with first function to null. So the menu doesn't hide and so no need to use the setTimeout. It's a very smart solution in the "jQuery way"!...</small></li>
<li><a href='http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page/' rel='bookmark' title='Permanent Link: A better process to find maximum z-index within a page'>A better process to find maximum z-index within a page</a> <small>A jQuery approach to find the maximum z-index of an element in DOM. You'll find it helpful and handy for your complex javascript application when you need to handle the absolute positioned message windows layers or similar cases....</small></li>
<li><a href='http://abcoder.com/css/css-equal-height-columns/' rel='bookmark' title='Permanent Link: CSS Equal Height Columns'>CSS Equal Height Columns</a> <small>Pure CSS three columns equal height hack with and without background image, bottom border fix and many more. Please go through the full article for different phenomena of div based multi-columns layout with free html, jQuery, javascript, css source code and images....</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/ie6-fix-for-select-box-over-absolute-positioned-element/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery cycle plugin as carousel</title>
		<link>http://abcoder.com/javascript/jquery/jquery-cycle-plugin-as-carousel/</link>
		<comments>http://abcoder.com/javascript/jquery/jquery-cycle-plugin-as-carousel/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 12:03:38 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[carousal]]></category>
		<category><![CDATA[carousel]]></category>
		<category><![CDATA[cycle]]></category>
		<category><![CDATA[cycle as carousel]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[scrollHorz]]></category>
		<category><![CDATA[scrollLeft]]></category>
		<category><![CDATA[scrollRight]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=72</guid>
		<description><![CDATA[You can use the jQuery cycle plugin as carousel. No need of special plugin for carousel. Just use the fx: 'scrollHorz' and that's all! This option is kinda hidden on the malsup site. Don't know why they never emphasize on this option!!


Related posts:<ol><li><a href='http://abcoder.com/javascript/jquery/advanced-cycle-plugin-integration/' rel='bookmark' title='Permanent Link: Advanced cycle plugin integration'>Advanced cycle plugin integration</a> <small>Load only the current slide of a jQuery cycle plugin slideshow. For large size images slideshow, loading all the images at once highly affects the page loading time. Here is the technique to load one image once only before starting of the next slide. It'll definitely reduce the page loading time....</small></li>
<li><a href='http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/' rel='bookmark' title='Permanent Link: Using Dreamweaver Spry validation with jQuery ajax form plugin'>Using Dreamweaver Spry validation with jQuery ajax form plugin</a> <small>A simple function for using Spry form validation of Dreamweaver with jQuery ajax form submit plugin. Just put this 3 lines of code in the "beforeSubmit" parameter of $.ajaxForm and that's all!...</small></li>
<li><a href='http://abcoder.com/javascript/jquery/jquery-vs-prototypejs/' rel='bookmark' title='Permanent Link: jQuery vs. prototype.js'>jQuery vs. prototype.js</a> <small>I&#8217;m basically a jQuery developer. I had little knowledge about prototype.js. All I knew is jQuery is better than prototype, so I never got interested about it. However, for some reason I started a project with prototype.js and each line of code makes it clearer that which one is better. Somehow I finished the project [...]...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The jQuery cycle plugin is really amazing! I love this plugin for its huge options for image/div slide show. Right now I&#8217;m working on a project which has 3 slideshow on one page. One is simple fade effect with text divs, another one is also fade effect with div + image + text and play/pause, next/back option. The third one is a simple carousel with continuous play mode.</p>
<p>I implemented the first two easily with cycle plugin. But I got stuck with the carousel one. The play and the next state is fine as I used the &#8220;scrollLeft&#8221; fx. The problem is when I click previous button the fx should be &#8220;scrollRight&#8221; and not &#8220;scrollLeft&#8221;. I thought it may need a little complex customized function to do this job of applying different transition effect on previous and next event. I had no clue for it. Even no help from google search! I do not like using a lot of plugins at a time. I know there is <a rel="nofollow"  href="http://sorgalla.com/projects/jcarousel/" title="jCarousel" target="_blank">jCarousel</a> / <a rel="nofollow" href="http://www.gmarwaha.com/jquery/jcarousellite/index.php" title="jCarousel lite" target="_blank">jCarousel lite</a> plugin for this, but I still believe there must be a way for doing this with cycle.</p>
<p>It took several hours to find out the simple solution. It&#8217;s already inside the cycle plugin, but kinda hidden! I am using the &#8220;scrollHorz&#8221; fx effect and it is fixed now. WOW! again I discovered that &#8220;cycle&#8221; is really a marvelous plugin of jQuery.</p>
<p>Here is the example on the malsup site: <a rel="nofollow" href="http://www.malsup.com/jquery/cycle/scrollhv.html" title="cycle as carousel" target="_blank">http://www.malsup.com/jquery/cycle/scrollhv.html</a></p>
<p>This is the simple code I used:</p>
<pre class="brush: jscript;">$('#carousels').cycle({
    prev: '#left-arrow',
    next: '#right-arrow',
    pause: 1,
    fx: 'scrollHorz',
    timeout: 6000
});</pre>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/jquery/advanced-cycle-plugin-integration/' rel='bookmark' title='Permanent Link: Advanced cycle plugin integration'>Advanced cycle plugin integration</a> <small>Load only the current slide of a jQuery cycle plugin slideshow. For large size images slideshow, loading all the images at once highly affects the page loading time. Here is the technique to load one image once only before starting of the next slide. It'll definitely reduce the page loading time....</small></li>
<li><a href='http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/' rel='bookmark' title='Permanent Link: Using Dreamweaver Spry validation with jQuery ajax form plugin'>Using Dreamweaver Spry validation with jQuery ajax form plugin</a> <small>A simple function for using Spry form validation of Dreamweaver with jQuery ajax form submit plugin. Just put this 3 lines of code in the "beforeSubmit" parameter of $.ajaxForm and that's all!...</small></li>
<li><a href='http://abcoder.com/javascript/jquery/jquery-vs-prototypejs/' rel='bookmark' title='Permanent Link: jQuery vs. prototype.js'>jQuery vs. prototype.js</a> <small>I&#8217;m basically a jQuery developer. I had little knowledge about prototype.js. All I knew is jQuery is better than prototype, so I never got interested about it. However, for some reason I started a project with prototype.js and each line of code makes it clearer that which one is better. Somehow I finished the project [...]...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/jquery/jquery-cycle-plugin-as-carousel/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>IE6 png alpha transparency fix for dynamically loaded images via ajax</title>
		<link>http://abcoder.com/javascript/ie6-png-alpha-transparency-fix-for-dynamically-loaded-images-via-ajax/</link>
		<comments>http://abcoder.com/javascript/ie6-png-alpha-transparency-fix-for-dynamically-loaded-images-via-ajax/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 10:13:55 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Core JavaScript]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajax loading]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[dynamic image]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[iepngfix]]></category>
		<category><![CDATA[iepngfix.htc]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[transparency]]></category>
		<category><![CDATA[transparent]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=66</guid>
		<description><![CDATA[Simple javascript and jQuery code for fixing the alpha transparency problem of png image on Internet explorer 6. iepngfix.htc does not work for dynamic images loaded via ajax call. But this simple code works great for dynamically loaded images.


Related posts:<ol><li><a href='http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/' rel='bookmark' title='Permanent Link: Using Dreamweaver Spry validation with jQuery ajax form plugin'>Using Dreamweaver Spry validation with jQuery ajax form plugin</a> <small>A simple function for using Spry form validation of Dreamweaver with jQuery ajax form submit plugin. Just put this 3 lines of code in the "beforeSubmit" parameter of $.ajaxForm and that's all!...</small></li>
<li><a href='http://abcoder.com/php/problem-with-resizing-corrupted-images-using-php-image-functions/' rel='bookmark' title='Permanent Link: Problem with resizing corrupted images using PHP image functions'>Problem with resizing corrupted images using PHP image functions</a> <small>PHP image functions can not resize corrupted image files. Use phpThumb for resizing images and you'll save a lot of time. Please read the full article for source code. Thanks again to phpThumb for their great effort!...</small></li>
<li><a href='http://abcoder.com/javascript/jquery/ajax-and-seo-is-it-possible-to-get-them-together/' rel='bookmark' title='Permanent Link: AJAX and SEO &#8211; Is it possible to get them together?'>AJAX and SEO &#8211; Is it possible to get them together?</a> <small>About 7 months ago I threw a question on LinkedIn, AJAX &amp; SEO. It was about is ajax seo friendly! (The website can be found here http://demo.zpbappi.com). Most of the people answered &#8220;NO&#8221;. All of them suggested me not to use 100% Ajax(ed) website as search endings do not render the javascript. The site has [...]...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>IE6 is always a nightmare for web developers. The most painful drawback is it does not support the alpha transparency of transparent png images and you know how to solve this problem using <a href="http://www.twinhelix.com/css/iepngfix/" title="IE6 png fix" rel="nofollow" target="_blank">iepngfix</a> or <a href="http://jquery.andreaseberhard.de/pngFix/" title="jQuery IE6 png fix" rel="nofollow" target="_blank">jquery.pngFix.js</a>.</p>
<p>You must be thinking.. what is new in my post then!! Have you ever used any of them for dynamic png images? Some people call it &#8220;Loading an image via ajax&#8221;. Let me explain what I mean by &#8220;dynamic png images&#8221;.. say you have a page where clicking on a link does not reload the page, but load a transparent/semitransparent png image. Most specifically, I was working on a <a href="http://www.wisedecor.com/" title="Wise Decor" rel="nofollow" target="_blank">project</a> where user types some text in a text box, it is converted to transparent png image on the fly using php and then it is displayed inside a div which has a graph-paper like background-image. This whole thing is done without reloading the page at all.</p>
<p>It looks okay on FF, safari, IE7 but on IE6 the transparent portion looks Grey. The iepngfix.htc script didn&#8217;t help, cos it only works on the images which are loaded and showed at the beginning of page loading. After the page is fully loaded and you load another png image using ajax this script won&#8217;t work. But I could not do that for my project as it is meant to be loaded dynamically using ajax for the sake of advanced user experience.</p>
<p>I started googling for it, no luck. Finally I modified a portion of code used in the iepngfix.htc file and fixed the problem using this simple javascript code. (FYI, I was using YUI so only the browser checking part is done using it, you can use jQuery or pure javascript for browser detection)</p>
<pre class="brush: jscript;">var textImage = new Image();
textImage.src = &quot;text.png&quot;; // src of the png image. okay if not ie6
if (YAHOO.env.ua.ie &gt; 5 &amp;&amp; YAHOO.env.ua.ie &lt; 7) { // if IE 5+ or 6 or 6+
    var timg_src = textImage.src;  // textImage
    var new_img = new Image();  // just as a preloader
    new_img.src = timg_src;

    new_img.onload = function(){ // remember, the image is being loaded dynamically, so apply the filter after it is loaded.
        var ti = document.getElementById(&quot;textImage&quot;); // the ID of the img tag where it'll be loaded
        ti.style.width = new_img.width; // you can get the width/height of image after it is fully loaded
        ti.style.height = new_img.height; // and you must &quot;DEFINE&quot; the image height/width. &quot;auto&quot; height/width won't work!

        // This is it. apply the filter :)
        ti.style.filter = &quot;progid:DXImageTransform.Microsoft.AlphaImageLoader(src='&quot; + timg_src + &quot;', sizingMethod='scale')&quot;;
        ti.setAttribute('src', 'blank.gif'); // don't forget this part. the image src is replaced with a blank gif image.
    }
}</pre>
<p>Here is another version of the code which is not for dynamic images. It&#8217;s alternative of iepngfix.htc. In some cases you may not like using iepngfix.htc, rather want to control it yourself. For example if your page has hundreds of png images which are not transparent and only a few images that are transparent, in this case using iepngfix.htc will make the whole process too slow. I applied a pseudo class &#8220;png&#8221; to all png images &amp; divs with png background image with fixed height &amp; width and applied this simple jQuery code:</p>
<pre class="brush: jscript;">$(window).load(function(){ // after all the images are loaded
    if ($.browser.msie &amp;&amp; parseInt($.browser.version.substr(0, 1)) &lt; 7) { // ie6 or 5
        $(&quot;img.png&quot;).each(function(){
            $(this).css(&quot;filter&quot;, &quot;progid:DXImageTransform.Microsoft.AlphaImageLoader(src='&quot; + $(this).attr('src') + &quot;', sizingMethod='scale')&quot;).attr(&quot;src&quot;, &quot;images/blank.gif&quot;);
        });
        $(&quot;div.png&quot;).each(function(){
            var bg = $(this).css(&quot;backgroundImage&quot;);
            bg.match(/^url[(&quot;']+(.*\.png)[)&quot;']+$/i);
            bg = RegExp.$1;
            $(this).css(&quot;filter&quot;, &quot;progid:DXImageTransform.Microsoft.AlphaImageLoader(src='&quot; + bg + &quot;', sizingMethod='crop')&quot;).css(&quot;backgroundImage&quot;, &quot;none&quot;);
        });
    }
});</pre>
<p>Hope you&#8217;ll find it helpful. Please let me know if you have any better idea.</p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/' rel='bookmark' title='Permanent Link: Using Dreamweaver Spry validation with jQuery ajax form plugin'>Using Dreamweaver Spry validation with jQuery ajax form plugin</a> <small>A simple function for using Spry form validation of Dreamweaver with jQuery ajax form submit plugin. Just put this 3 lines of code in the "beforeSubmit" parameter of $.ajaxForm and that's all!...</small></li>
<li><a href='http://abcoder.com/php/problem-with-resizing-corrupted-images-using-php-image-functions/' rel='bookmark' title='Permanent Link: Problem with resizing corrupted images using PHP image functions'>Problem with resizing corrupted images using PHP image functions</a> <small>PHP image functions can not resize corrupted image files. Use phpThumb for resizing images and you'll save a lot of time. Please read the full article for source code. Thanks again to phpThumb for their great effort!...</small></li>
<li><a href='http://abcoder.com/javascript/jquery/ajax-and-seo-is-it-possible-to-get-them-together/' rel='bookmark' title='Permanent Link: AJAX and SEO &#8211; Is it possible to get them together?'>AJAX and SEO &#8211; Is it possible to get them together?</a> <small>About 7 months ago I threw a question on LinkedIn, AJAX &amp; SEO. It was about is ajax seo friendly! (The website can be found here http://demo.zpbappi.com). Most of the people answered &#8220;NO&#8221;. All of them suggested me not to use 100% Ajax(ed) website as search endings do not render the javascript. The site has [...]...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/ie6-png-alpha-transparency-fix-for-dynamically-loaded-images-via-ajax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Dreamweaver Spry validation with jQuery ajax form plugin</title>
		<link>http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/</link>
		<comments>http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 13:30:26 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Core JavaScript]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajax form submit]]></category>
		<category><![CDATA[ajax submit]]></category>
		<category><![CDATA[click]]></category>
		<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Spry]]></category>
		<category><![CDATA[submit]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=60</guid>
		<description><![CDATA[A simple function for using Spry form validation of Dreamweaver with jQuery ajax form submit plugin. Just put this 3 lines of code in the "beforeSubmit" parameter of $.ajaxForm and that's all!


Related posts:<ol><li><a href='http://abcoder.com/javascript/jquery/jquery-cycle-plugin-as-carousel/' rel='bookmark' title='Permanent Link: jQuery cycle plugin as carousel'>jQuery cycle plugin as carousel</a> <small>You can use the jQuery cycle plugin as carousel. No need of special plugin for carousel. Just use the fx: 'scrollHorz' and that's all! This option is kinda hidden on the malsup site. Don't know why they never emphasize on this option!!...</small></li>
<li><a href='http://abcoder.com/javascript/ie6-png-alpha-transparency-fix-for-dynamically-loaded-images-via-ajax/' rel='bookmark' title='Permanent Link: IE6 png alpha transparency fix for dynamically loaded images via ajax'>IE6 png alpha transparency fix for dynamically loaded images via ajax</a> <small>Simple javascript and jQuery code for fixing the alpha transparency problem of png image on Internet explorer 6. iepngfix.htc does not work for dynamic images loaded via ajax call. But this simple code works great for dynamically loaded images....</small></li>
<li><a href='http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/' rel='bookmark' title='Permanent Link: Gmail uploader clone with drag drop feature : Free Download with source code'>Gmail uploader clone with drag drop feature : Free Download with source code</a> <small>Gmail file uploader clone with drag drop feature using jQuery. Download full working source code in a single zip file for free....</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Writing form validation code manually is a boring task. Not only that, editing or adding new fields each time and modifying the validation code accordingly is such a pain. When Dreamweaver added the Spry form validation with CS3 the nightmare is over. The greatest feature of using it is you can do the form validation work automatically with a couple of mouse clicks and no hand written code! And you can easily change/edit or add/remove the fields.</p>
<p>I know jQuery has simple validation plugin but you have to write the codes for it, which is time consuming. I always use the spry validation of dreamweaver as I learned using it for it&#8217;s simplicity. When I tried to use it with the <a rel ="nofollow" href="http://malsup.com/jquery/form/" target="_blank">jQuery ajax form submit plugin</a> I got disappointed. It didn&#8217;t work! I didn&#8217;t stop trying. And finally I found the way which I&#8217;m gonna share with you :)</p>
<p>Here is the simple code that you need in the &#8220;beforeSubmit&#8221; parameter of $.ajaxForm</p>
<pre class="brush: jscript;">$(&quot;#formID&quot;).ajaxForm({
    url: &quot;submit.php&quot;,
    beforeSubmit: function(formData, jqForm, options){
        if (Spry) { // checks if Spry is used in your page
            var r = Spry.Widget.Form.validate(jqForm[0]); // validates the form
            if (!r)
                return r;
        }
    },
    success: successFunction,
    complete: completeFunction
});</pre>
<p>Hope that&#8217;ll help a lot boosting your web development.</p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/jquery/jquery-cycle-plugin-as-carousel/' rel='bookmark' title='Permanent Link: jQuery cycle plugin as carousel'>jQuery cycle plugin as carousel</a> <small>You can use the jQuery cycle plugin as carousel. No need of special plugin for carousel. Just use the fx: 'scrollHorz' and that's all! This option is kinda hidden on the malsup site. Don't know why they never emphasize on this option!!...</small></li>
<li><a href='http://abcoder.com/javascript/ie6-png-alpha-transparency-fix-for-dynamically-loaded-images-via-ajax/' rel='bookmark' title='Permanent Link: IE6 png alpha transparency fix for dynamically loaded images via ajax'>IE6 png alpha transparency fix for dynamically loaded images via ajax</a> <small>Simple javascript and jQuery code for fixing the alpha transparency problem of png image on Internet explorer 6. iepngfix.htc does not work for dynamic images loaded via ajax call. But this simple code works great for dynamically loaded images....</small></li>
<li><a href='http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/' rel='bookmark' title='Permanent Link: Gmail uploader clone with drag drop feature : Free Download with source code'>Gmail uploader clone with drag drop feature : Free Download with source code</a> <small>Gmail file uploader clone with drag drop feature using jQuery. Download full working source code in a single zip file for free....</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Gmail uploader clone with drag drop feature : Free Download with source code</title>
		<link>http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/</link>
		<comments>http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/#comments</comments>
		<pubDate>Wed, 13 May 2009 16:12:19 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[Core JavaScript]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ajax form submit]]></category>
		<category><![CDATA[ajax image uploader]]></category>
		<category><![CDATA[ajax submit]]></category>
		<category><![CDATA[ajax uploader]]></category>
		<category><![CDATA[drag and drop]]></category>
		<category><![CDATA[drag drop]]></category>
		<category><![CDATA[dynamic file uploader]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[gmail file uploader]]></category>
		<category><![CDATA[gmail like image file uploader]]></category>
		<category><![CDATA[gmail uploader]]></category>
		<category><![CDATA[Uploader]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=31</guid>
		<description><![CDATA[Gmail file uploader clone with drag drop feature using jQuery. Download full working source code in a single zip file for free.


Related posts:<ol><li><a href='http://abcoder.com/javascript/flickr-uploader-clone-free-download-with-source-code/' rel='bookmark' title='Permanent Link: Flickr Uploader Clone: Free Download with source code'>Flickr Uploader Clone: Free Download with source code</a> <small>Flickr Uploader clone for free using javascript and flash. PHP is used for server side. Download if for completely free in one zip file....</small></li>
<li><a href='http://abcoder.com/javascript/jquery/advanced-cycle-plugin-integration/' rel='bookmark' title='Permanent Link: Advanced cycle plugin integration'>Advanced cycle plugin integration</a> <small>Load only the current slide of a jQuery cycle plugin slideshow. For large size images slideshow, loading all the images at once highly affects the page loading time. Here is the technique to load one image once only before starting of the next slide. It'll definitely reduce the page loading time....</small></li>
<li><a href='http://abcoder.com/google/gmail-google/new-phonetic-keyboard-in-gmail/' rel='bookmark' title='Permanent Link: New Phonetic keyboard in Gmail'>New Phonetic keyboard in Gmail</a> <small>Phonetic keyboard inside is a new astonishing &amp; useful feature of Gmail. Currently it supports 12 languages including Bengali, Hindi, Arabic with rtl. It's really an appreciating step of gmail with due respect to mother-tongue of people around the world. Keep up the good work, thanks to Gmail....</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Recently I developed the gmail file uploader clone using jQuery. Here is the online <a title="Gmail uploader clone with drag drop thumbnail feature" href="http://abcoder.com/Gmail-Uploader/" target="_blank"><strong>demo</strong></a>.</p>
<p><img src="http://abcoder.com/Gmail-Uploader/gmail-uploader-clone.jpg" alt="Gmail uploader clone with drag drop feature screen shot" width="500" height="211" /></p>
<p>I added some extra functionalists.<br />
You can see the image thumbnails after the uploading is completed. There is a cross button at top right of each thumbnail, clicking on it will delete the image. If you right click on the image you&#8217;ll see a context menu from which you can delete the image too along with replace the existing image option.</p>
<p>The most interesting feature is you can drag drop the thumbnails to change the order. Yes this is essential when you need to maintain the order of images in classified sites after uploading them, also a little modification will let you edit the image order later time by dragging the thumbnails. The image name and the image title is dynamically added in the &#8220;updateInfo&#8221; form and send(post) via the hidden fields imgs[] and imgComment[]  array. You can easily get the order by php using foreach loop on $_POST['imgs'] field. Just hit the submit button after uploading 2 images and you will see the output on post.php page. (hope that makes sense).</p>
<p><a title="Download gmail uploader clone with drag drop feature in a single zip file for absolutely free!" href="http://www.abcoder.com/Gmail-Uploader/Gmail-Uploader.zip" target="_blank"><strong>Download it for free in a single zip file</strong></a></p>
<p>If you have any better example of gmail uploader clone please share the links in comments.</p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/flickr-uploader-clone-free-download-with-source-code/' rel='bookmark' title='Permanent Link: Flickr Uploader Clone: Free Download with source code'>Flickr Uploader Clone: Free Download with source code</a> <small>Flickr Uploader clone for free using javascript and flash. PHP is used for server side. Download if for completely free in one zip file....</small></li>
<li><a href='http://abcoder.com/javascript/jquery/advanced-cycle-plugin-integration/' rel='bookmark' title='Permanent Link: Advanced cycle plugin integration'>Advanced cycle plugin integration</a> <small>Load only the current slide of a jQuery cycle plugin slideshow. For large size images slideshow, loading all the images at once highly affects the page loading time. Here is the technique to load one image once only before starting of the next slide. It'll definitely reduce the page loading time....</small></li>
<li><a href='http://abcoder.com/google/gmail-google/new-phonetic-keyboard-in-gmail/' rel='bookmark' title='Permanent Link: New Phonetic keyboard in Gmail'>New Phonetic keyboard in Gmail</a> <small>Phonetic keyboard inside is a new astonishing &amp; useful feature of Gmail. Currently it supports 12 languages including Bengali, Hindi, Arabic with rtl. It's really an appreciating step of gmail with due respect to mother-tongue of people around the world. Keep up the good work, thanks to Gmail....</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>jQuery vs. prototype.js</title>
		<link>http://abcoder.com/javascript/jquery/jquery-vs-prototypejs/</link>
		<comments>http://abcoder.com/javascript/jquery/jquery-vs-prototypejs/#comments</comments>
		<pubDate>Sun, 10 May 2009 16:21:57 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[code compare]]></category>
		<category><![CDATA[code optimization]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[compare jquery prototype]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery vs. prototype]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[prototype.js]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=30</guid>
		<description><![CDATA[I&#8217;m basically a jQuery developer. I had little knowledge about prototype.js. All I knew is jQuery is better than prototype, so I never got interested about it. However, for some reason I started a project with prototype.js and each line of code makes it clearer that which one is better. Somehow I finished the project [...]


Related posts:<ol><li><a href='http://abcoder.com/javascript/jquery/jquery-cycle-plugin-as-carousel/' rel='bookmark' title='Permanent Link: jQuery cycle plugin as carousel'>jQuery cycle plugin as carousel</a> <small>You can use the jQuery cycle plugin as carousel. No need of special plugin for carousel. Just use the fx: 'scrollHorz' and that's all! This option is kinda hidden on the malsup site. Don't know why they never emphasize on this option!!...</small></li>
<li><a href='http://abcoder.com/javascript/jquery/jquery-live-event/' rel='bookmark' title='Permanent Link: jQuery &#8220;live&#8221; event'>jQuery &#8220;live&#8221; event</a> <small>jQuery live event is a great new dynamic feature. You can assign live events to current elements in dom as well as it'll be automatically applied to newly created (future) elements. You do not need to bind the event each time after creating a new element again and again unlike bind event. It'll make your code clean and you'll get more time for dating :P...</small></li>
<li><a href='http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page/' rel='bookmark' title='Permanent Link: A better process to find maximum z-index within a page'>A better process to find maximum z-index within a page</a> <small>A jQuery approach to find the maximum z-index of an element in DOM. You'll find it helpful and handy for your complex javascript application when you need to handle the absolute positioned message windows layers or similar cases....</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m basically a jQuery developer. I had little knowledge about prototype.js. All I knew is jQuery is better than prototype, so I never got interested about it.</p>
<p>However, for some reason I started a project with prototype.js and each line of code makes it clearer that which one is better. Somehow I finished the project using prototype.js along with scriptaculous.js and effects.js. Everything was fine in IE7 and FF 3. But it breaks in IE6. I was not happy with the unnecessary huge code. For example there is no live event in prototype.js, you can not apply an event to a group of elements with same class (You have to use loop for it), there is nothing like jQuery.animate function by which you can do any css animation (You have to add scriptaculous.js for some pre-built animation effects!) and a lot more limitations.</p>
<p>Even the scriptaculous.js is not that rich, for example using ScrollTo effect you can smoothly scroll to any anchor tag &#8220;vertically&#8221; only but no way of ScrollTo horizontally(!) in case your page is landscape orianted. Here is the code that I used instead(I found the idea from the source code of ScrollTo function):</p>
<pre class="brush: jscript;">var scrollOffsets = document.viewport.getScrollOffsets();
var elementOffsets = $$('div.active ul li')[index].cumulativeOffset();
new Effect.Tween(null,scrollOffsets.left,elementOffsets[0] - lo,function(p){window.scrollTo(p,scrollOffsets.top);});</pre>
<p>The equivalend jQuery code is:</p>
<pre class="brush: jscript;">$(&quot;html,body&quot;).animate({
scrollLeft: ($('div.active ul li').eq(index).offset().left - leftOffset) + 'px'
}, &quot;slow&quot;, &quot;swing&quot;);</pre>
<p>There are a lot more examples like this. The summary is the code using prototype.js was 180 lines and the equivalent code using jQuery is now only 160 lines + a lot of mental relief that it would work on all browsers :)</p>
<p><span style="color: #c0c0c0;"><em>One thing I want to make clear is I have no intention to boost anything. In fact both of them are free.</em></span></p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/jquery/jquery-cycle-plugin-as-carousel/' rel='bookmark' title='Permanent Link: jQuery cycle plugin as carousel'>jQuery cycle plugin as carousel</a> <small>You can use the jQuery cycle plugin as carousel. No need of special plugin for carousel. Just use the fx: 'scrollHorz' and that's all! This option is kinda hidden on the malsup site. Don't know why they never emphasize on this option!!...</small></li>
<li><a href='http://abcoder.com/javascript/jquery/jquery-live-event/' rel='bookmark' title='Permanent Link: jQuery &#8220;live&#8221; event'>jQuery &#8220;live&#8221; event</a> <small>jQuery live event is a great new dynamic feature. You can assign live events to current elements in dom as well as it'll be automatically applied to newly created (future) elements. You do not need to bind the event each time after creating a new element again and again unlike bind event. It'll make your code clean and you'll get more time for dating :P...</small></li>
<li><a href='http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page/' rel='bookmark' title='Permanent Link: A better process to find maximum z-index within a page'>A better process to find maximum z-index within a page</a> <small>A jQuery approach to find the maximum z-index of an element in DOM. You'll find it helpful and handy for your complex javascript application when you need to handle the absolute positioned message windows layers or similar cases....</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/jquery/jquery-vs-prototypejs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
