<?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>Mukesh Chapagain&#039;s Blog &#187; jQuery</title>
	<atom:link href="http://blog.chapagain.com.np/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chapagain.com.np</link>
	<description>PHP Magento jQuery SQL Wordpress Joomla Programming &#38; Tutorial</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:54:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Magento jQuery: How to use them together?</title>
		<link>http://blog.chapagain.com.np/magento-jquery-how-to-use-them-together/</link>
		<comments>http://blog.chapagain.com.np/magento-jquery-how-to-use-them-together/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 00:34:28 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1095</guid>
		<description><![CDATA[By default, Magento contains and uses the Prototype javascript library. You can also integrate the other most popular javascript library &#8216;jQuery&#8216; in your Magento site. While integrating jQuery in Magento, you might get some javascript conflict and errors as you will be using two javascript libraries (prototype and jQuery) at a time. This is caused [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-print-array-and-object/' rel='bookmark' title='Permanent Link: jQuery: Print array and object'>jQuery: Print array and object</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>By default, Magento contains and uses the <strong>Prototype</strong> javascript library. You can also integrate the other most popular javascript library &#8216;<strong>jQuery</strong>&#8216; in your Magento site. </p>
<p>While integrating jQuery in Magento, you might get some javascript conflict and errors as you will be using two javascript libraries (prototype and jQuery) at a time. This is caused because prototype also uses &#8216;<strong>$</strong>&#8216; as a function or variable name, just as jQuery does.</p>
<p><span id="more-1095"></span></p>
<p>Well, jQuery has a solution for this conflict case. Here&#8217;s what <a href="http://api.jquery.com/jQuery.noConflict/" rel="nofollow">jQuery</a> has to say about the conflict:-</p>
<blockquote><p>
Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery&#8217;s case, $ is just an alias for jQuery, so all functionality is available without using $. If we need to use another JavaScript library alongside jQuery, we can return control of $ back to the other library with a call to $.noConflict():
</p></blockquote>
<p>Here, I will explain you on how you can integrate jQuery in Magento without any conflict and error.</p>
<p>Below is the <strong>step-by-step guide to integrate jQuery with Magento</strong>:-</p>
<p>1) Download jQuery from <a href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery" rel="nofollow">jquery.com</a><br />
2) Copy the jquery file to the following directory: <strong>skin/frontend/default/your_theme/js/</strong><br />
3) Open <strong>app/design/frontend/default/your_theme/layout/page.xml</strong><br />
4) In page.xml file, search for block with name &#8216;<strong>head</strong>&#8216; and add the following code inside it (I suppose that your jquery file name is <strong>jquery.js</strong>):-</p>
<pre class="brush: xml; title: ; notranslate">
	&lt;action method=&quot;addItem&quot;&gt;&lt;type&gt;skin_js&lt;/type&gt;&lt;name&gt;js/jquery.js&lt;/name&gt;&lt;/action&gt;
	</pre>
<p>5) Removing conflict between two javascript libraries (prototype and jquery):<br />
	- Open <strong>app/design/frontend/default/your_theme/template/page/head.phtml</strong><br />
	- Add the following code at the end of this page:-</p>
<pre class="brush: jscript; title: ; notranslate">
		&lt;script type=&quot;text/javascript&quot;&gt;
			jQuery.noConflict();
		&lt;/script&gt;
		</pre>
<p>6) That&#8217;s all. You are done. Now, you can use jQuery in your Magento website freely and without any conflict. :)</p>
<p>Hope this helps. Thanks.</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1095&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-print-array-and-object/' rel='bookmark' title='Permanent Link: jQuery: Print array and object'>jQuery: Print array and object</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/magento-jquery-how-to-use-them-together/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using jQuery &amp; AJAX: Populate Selection List</title>
		<link>http://blog.chapagain.com.np/using-jquery-ajax-populate-selection-list/</link>
		<comments>http://blog.chapagain.com.np/using-jquery-ajax-populate-selection-list/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 03:24:10 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajax]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=1055</guid>
		<description><![CDATA[In this tutorial, I will be showing how you can use AJAX with jQuery. From jQuery, you can send values to php page as GET or POST parameters. You can use load() function OR ajax() function of jQuery to accomplish the AJAX functionality. View Demo &#124;&#124; Download Code In the example below, I will show [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/simple-and-easy-jquery-tabs-with-ajax-and-php/' rel='bookmark' title='Permanent Link: Simple and easy jQuery tabs with AJAX and PHP'>Simple and easy jQuery tabs with AJAX and PHP</a></li>
<li><a href='http://blog.chapagain.com.np/creating-selection-list-using-foreach-and-section-loop-in-smarty/' rel='bookmark' title='Permanent Link: Creating selection list, using foreach and section loop in Smarty'>Creating selection list, using foreach and section loop in Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/magento-get-country-and-region-collection/' rel='bookmark' title='Permanent Link: Magento: Get country and region collection'>Magento: Get country and region collection</a></li>
<li><a href='http://blog.chapagain.com.np/magento-jquery-how-to-use-them-together/' rel='bookmark' title='Permanent Link: Magento jQuery: How to use them together?'>Magento jQuery: How to use them together?</a></li>
<li><a href='http://blog.chapagain.com.np/multiple-file-upload-with-jquery-and-php/' rel='bookmark' title='Permanent Link: Multiple file upload with jQuery and php'>Multiple file upload with jQuery and php</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In this tutorial, I will be showing how you can use <strong>AJAX with jQuery</strong>. </p>
<p>From jQuery, you can send values to php page as GET or POST parameters. </p>
<p>You can use <strong>load()</strong> function OR <strong>ajax()</strong> function of jQuery to accomplish the AJAX functionality.</p>
<p><span id="more-1055"></span></p>
<p><strong><a href="http://blog.chapagain.com.np/examples/jquery-ajax-selection-list/"rel="nofollow" target="_blank" >View Demo</a></strong> || <strong><a href="http://chapagain.googlecode.com/files/jquery-ajax.zip"rel="nofollow" >Download Code</a></strong></p>
<p>In the example below, I will show you how you can send parameters as GET method with the <strong>load()</strong> jQuery function.</p>
<p>In this example, there is a selection list of countries. Upon selecting any country, AJAX is used and respective cities are fetched.</p>
<h3>Using GET method and load() function</h3>
<p><strong>HTML code of selection list</strong></p>
<pre class="brush: xml; title: ; notranslate">
Countries:
&lt;select name=&quot;country&quot;&gt;
	&lt;option value=&quot;&quot;&gt;Please Select&lt;/option&gt;
	&lt;option value=&quot;1&quot;&gt;Nepal&lt;/option&gt;
	&lt;option value=&quot;2&quot;&gt;India&lt;/option&gt;
	&lt;option value=&quot;3&quot;&gt;China&lt;/option&gt;
	&lt;option value=&quot;4&quot;&gt;USA&lt;/option&gt;
	&lt;option value=&quot;5&quot;&gt;UK&lt;/option&gt;
&lt;/select&gt;

&lt;div id=&quot;cityAjax&quot; style=&quot;display:none&quot;&gt;
	&lt;select name=&quot;city&quot;&gt;
		&lt;option value=&quot;&quot;&gt;Please Select&lt;/option&gt;
	&lt;/select&gt;
&lt;/div&gt;
</pre>
<p><strong>Using load() function to fetch cities with GET method</strong></p>
<pre class="brush: jscript; title: ; notranslate">
	jQuery(document).ready(function(){
		// when any option from country list is selected
		jQuery(&quot;select[name='country']&quot;).change(function(){	

			// path of ajax-loader gif image
			var ajaxLoader = &quot;&lt;img src='../ajax-loader.gif' alt='loading...' /&gt;&quot;;

			// get the selected option value of country
			var optionValue = jQuery(&quot;select[name='country']&quot;).val();		

			/**
			 * pass country value through GET method as query string
			 * the 'status' parameter is only a dummy parameter (just to show how multiple parameters can be passed)
			 * if we get response from data.php, then only the cityAjax div is displayed
			 * otherwise the cityAjax div remains hidden
			 */
			jQuery(&quot;#cityAjax&quot;)
				.html(ajaxLoader)
				.load('data.php', &quot;country=&quot;+optionValue+&quot;&amp;status=1&quot;, function(response){
					if(response) {
						jQuery(&quot;#cityAjax&quot;).css('display', '');
					} else {
						jQuery(&quot;#cityAjax&quot;).css('display', 'none');
					}
			});
		});
	});
</pre>
<p><strong>PHP code to populate cities selection list</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$country = $_GET['country'];

if(!$country) {
	return false;
}

$cities = array(
			1 =&gt; array('Kathmandu','Bhaktapur','Patan','Pokhara','Lumbini'),
			2 =&gt; array('Delhi','Mumbai','Kolkata','Bangalore','Hyderabad','Pune','Chennai','Jaipur','Goa'),
			3 =&gt; array('Beijing','Chengdu','Lhasa','Macau','Shanghai'),
			4 =&gt; array('Los Angeles','New York','Dallas','Boston','Seattle','Washington','Las Vegas'),
			5 =&gt; array('Birmingham','Bradford','Cambridge','Derby','Lincoln','Liverpool','Manchester')
		);

$currentCities = $cities[$country];
?&gt;

City:
&lt;select name=&quot;city&quot;&gt;
	&lt;option value=&quot;&quot;&gt;Please Select&lt;/option&gt;
	&lt;?php
	foreach($currentCities as $city) {
		?&gt;
		&lt;option value=&quot;&lt;?php echo $city; ?&gt;&quot;&gt;&lt;?php echo $city; ?&gt;&lt;/option&gt;
		&lt;?php
	}
	?&gt;
&lt;/select&gt;
</pre>
<h3>Similarly, you can use POST method and load() function.</h3>
<p><strong>Using load() function to fetch cities with POST method</strong></p>
<pre class="brush: jscript; title: ; notranslate">
	jQuery(document).ready(function(){
		// when any option from country list is selected
		jQuery(&quot;select[name='country']&quot;).change(function(){	

			// path of ajax-loader gif image
			var ajaxLoader = &quot;&lt;img src='../ajax-loader.gif' alt='loading...' /&gt;&quot;;

			// get the selected option value of country
			var optionValue = jQuery(&quot;select[name='country']&quot;).val();		

			/**
			 * pass country value through POST method
			 * the 'status' parameter is only a dummy parameter (just to show how multiple parameters can be passed)
			 * if we get response from data.php, then only the cityAjax div is displayed
			 * otherwise the cityAjax div remains hidden
			 */
			jQuery(&quot;#cityAjax&quot;)
				.html(ajaxLoader)
				.load('data.php', {country: optionValue, status: 1}, function(response){
					if(response) {
						jQuery(&quot;#cityAjax&quot;).css('display', '');
					} else {
						jQuery(&quot;#cityAjax&quot;).css('display', 'none');
					}
			});
		});
	});
</pre>
<h3>For AJAX use, jQuery also has another function called <strong>ajax()</strong>.</h3>
<p>Below is the code on how we can use it:-</p>
<p><strong>Using ajax() function to fetch cities with GET method</strong></p>
<pre class="brush: jscript; title: ; notranslate">
	jQuery(document).ready(function(){
		// when any option from country list is selected
		jQuery(&quot;select[name='country']&quot;).change(function(){				

			// get the selected option value of country
			var optionValue = jQuery(&quot;select[name='country']&quot;).val();		

			/**
			 * pass country value through GET method as query string
			 * the 'status' parameter is only a dummy parameter (just to show how multiple parameters can be passed)
			 * if we get response from data.php, then only the cityAjax div is displayed
			 * otherwise the cityAjax div remains hidden
			 * 'beforeSend' is used to display loader image
			 * 'complete' is used to hide the loader image
			 */
			jQuery.ajax({
				type: &quot;GET&quot;,
				url: &quot;data.php&quot;,
				data: &quot;country=&quot;+optionValue+&quot;&amp;status=1&quot;,
				beforeSend: function(){ jQuery(&quot;#ajaxLoader&quot;).show(); },
				complete: function(){ jQuery(&quot;#ajaxLoader&quot;).hide(); },
				success: function(response){
					jQuery(&quot;#cityAjax&quot;).html(response);
					jQuery(&quot;#cityAjax&quot;).show();
				}
			});
		});
	});
</pre>
<p><strong>Using ajax() function to fetch cities with POST method</strong></p>
<pre class="brush: jscript; title: ; notranslate">
	jQuery(document).ready(function(){
		// when any option from country list is selected
		jQuery(&quot;select[name='country']&quot;).change(function(){				

			// get the selected option value of country
			var optionValue = jQuery(&quot;select[name='country']&quot;).val();		

			/**
			 * pass country value through POST method
			 * the 'status' parameter is only a dummy parameter (just to show how multiple parameters can be passed)
			 * if we get response from data.php, then only the cityAjax div is displayed
			 * otherwise the cityAjax div remains hidden
			 * 'beforeSend' is used to display loader image
			 * 'complete' is used to hide the loader image
			 */
			jQuery.ajax({
				type: &quot;POST&quot;,
				url: &quot;data.php&quot;,
				data: ({country: optionValue, status: 1}),
				beforeSend: function(){ jQuery(&quot;#ajaxLoader&quot;).show(); },
				complete: function(){ jQuery(&quot;#ajaxLoader&quot;).hide(); },
				success: function(response){
					jQuery(&quot;#cityAjax&quot;).html(response);
					jQuery(&quot;#cityAjax&quot;).show();
				}
			});
		});
	});
</pre>
<p><strong><a href="http://blog.chapagain.com.np/examples/jquery-ajax-selection-list/"rel="nofollow" target="_blank" >View Demo</a></strong> || <strong><a href="http://chapagain.googlecode.com/files/jquery-ajax.zip"rel="nofollow" >Download Code</a></strong></p>
<p>Hope this helps. Thanks.</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=1055&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/simple-and-easy-jquery-tabs-with-ajax-and-php/' rel='bookmark' title='Permanent Link: Simple and easy jQuery tabs with AJAX and PHP'>Simple and easy jQuery tabs with AJAX and PHP</a></li>
<li><a href='http://blog.chapagain.com.np/creating-selection-list-using-foreach-and-section-loop-in-smarty/' rel='bookmark' title='Permanent Link: Creating selection list, using foreach and section loop in Smarty'>Creating selection list, using foreach and section loop in Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/magento-get-country-and-region-collection/' rel='bookmark' title='Permanent Link: Magento: Get country and region collection'>Magento: Get country and region collection</a></li>
<li><a href='http://blog.chapagain.com.np/magento-jquery-how-to-use-them-together/' rel='bookmark' title='Permanent Link: Magento jQuery: How to use them together?'>Magento jQuery: How to use them together?</a></li>
<li><a href='http://blog.chapagain.com.np/multiple-file-upload-with-jquery-and-php/' rel='bookmark' title='Permanent Link: Multiple file upload with jQuery and php'>Multiple file upload with jQuery and php</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/using-jquery-ajax-populate-selection-list/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>jQuery: Grey out background and preview image as popup</title>
		<link>http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/</link>
		<comments>http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 19:45:01 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[grey out]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[popup]]></category>
		<category><![CDATA[preview]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=554</guid>
		<description><![CDATA[Here, I will show you how to preview Image with grey out background effect. I mean, you will be able to preview large image when you click the thumbnail image. The background of the page will be greyed and the image will be displayed as popup. View Demo &#124;&#124; Download Code The following code will [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-a-simple-tooltip/' rel='bookmark' title='Permanent Link: jQuery: A simple Tooltip'>jQuery: A simple Tooltip</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-set-time-interval-between-events-with-queue-function/' rel='bookmark' title='Permanent Link: jQuery: Set time interval between events with queue function'>jQuery: Set time interval between events with queue function</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here, I will show you how to preview Image with grey out background effect. I mean, you will be able to preview large image when you click the thumbnail image. The background of the page will be greyed and the image will be displayed as popup.</p>
<p><strong><a href="http://blog.chapagain.com.np/examples/image-preview-grey-out/" target="_blank">View Demo</a> || <a href="http://chapagain.googlecode.com/files/image-preview-grey-out.zip" rel="nofollow"  target="_blank">Download Code</a></strong></p>
<p><span id="more-554"></span></p>
<p>The following code will centerlize the popup large image.</p>
<pre class="brush: jscript; title: ; notranslate">
jQuery.fn.center = function () {
	this.css(&quot;position&quot;,&quot;absolute&quot;);
	this.css(&quot;top&quot;, ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + &quot;px&quot;);
	this.css(&quot;left&quot;, ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + &quot;px&quot;);
	return this;
}
</pre>
<p>The css id &#8216;background&#8217; has black background color and initially it is hidden. When the thumbnail image is clicked, the div with the id &#8216;background&#8217; is made visible with fadeIn effect. The opacity is set 0.7 which makes the div slightly transparent and somewhat grey in color.</p>
<p>The div with id &#8216;large&#8217; is made to display at center with fadeIn effect. The large image is displayed in this div. The image source will be the href link of the thumbnail image. The <em>rel</em> tag is taken as the caption and is displayed just below the image.</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function() {
	$(&quot;#thumbnail img&quot;).click(function(e){

		$(&quot;#background&quot;).css({&quot;opacity&quot; : &quot;0.7&quot;})
						.fadeIn(&quot;slow&quot;);

		$(&quot;#large&quot;).html(&quot;&lt;img src='&quot;+$(this).parent().attr(&quot;href&quot;)+&quot;' alt='&quot;+$(this).attr(&quot;alt&quot;)+&quot;' /&gt;&lt;br/&gt;&quot;+$(this).attr(&quot;rel&quot;)+&quot;&quot;)
				   .center()
				   .fadeIn(&quot;slow&quot;);

		return false;
	});

	$(document).keypress(function(e){
		if(e.keyCode==27){
			$(&quot;#background&quot;).fadeOut(&quot;slow&quot;);
			$(&quot;#large&quot;).fadeOut(&quot;slow&quot;);
		}
	});

	$(&quot;#background&quot;).click(function(){
		$(&quot;#background&quot;).fadeOut(&quot;slow&quot;);
		$(&quot;#large&quot;).fadeOut(&quot;slow&quot;);
	});

	$(&quot;#large&quot;).click(function(){
		$(&quot;#background&quot;).fadeOut(&quot;slow&quot;);
		$(&quot;#large&quot;).fadeOut(&quot;slow&quot;);
	});

});
</pre>
<p>Here&#8217;s the full source code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;jQuery: Image preview in popup with Grey out background&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.4.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
	jQuery.fn.center = function () {
		this.css(&quot;position&quot;,&quot;absolute&quot;);
		this.css(&quot;top&quot;, ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + &quot;px&quot;);
		this.css(&quot;left&quot;, ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + &quot;px&quot;);
		return this;
	}

	$(document).ready(function() {
		$(&quot;#thumbnail img&quot;).click(function(e){

			$(&quot;#background&quot;).css({&quot;opacity&quot; : &quot;0.7&quot;})
							.fadeIn(&quot;slow&quot;);

			$(&quot;#large&quot;).html(&quot;&lt;img src='&quot;+$(this).parent().attr(&quot;href&quot;)+&quot;' alt='&quot;+$(this).attr(&quot;alt&quot;)+&quot;' /&gt;&lt;br/&gt;&quot;+$(this).attr(&quot;rel&quot;)+&quot;&quot;)
					   .center()
					   .fadeIn(&quot;slow&quot;);

			return false;
		});

		$(document).keypress(function(e){
			if(e.keyCode==27){
				$(&quot;#background&quot;).fadeOut(&quot;slow&quot;);
				$(&quot;#large&quot;).fadeOut(&quot;slow&quot;);
			}
		});

		$(&quot;#background&quot;).click(function(){
			$(&quot;#background&quot;).fadeOut(&quot;slow&quot;);
			$(&quot;#large&quot;).fadeOut(&quot;slow&quot;);
		});

		$(&quot;#large&quot;).click(function(){
			$(&quot;#background&quot;).fadeOut(&quot;slow&quot;);
			$(&quot;#large&quot;).fadeOut(&quot;slow&quot;);
		});

	});
&lt;/script&gt;
&lt;style&gt;
img {
	border: none;
}
#thumbnail img {
	cursor: pointer;
}
#large {
	display: none;
	position: absolute;
	background: #FFFFFF;
	padding: 5px;
	z-index: 10;
	min-height: 200px;
	min-width: 200px;
	color: #336699;
}
#background{
	display: none;
	position: absolute;
	height: 100%;
	width: 100%;
	top: 0;
	left: 0;
	background: #000000;
	z-index: 1;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div align=&quot;center&quot;&gt;
   &lt;div id=&quot;thumbnail&quot;&gt;
		&lt;h3&gt;Click on the image&lt;/h3&gt;
	    &lt;a href=&quot;hills.jpg&quot;&gt;&lt;img src=&quot;hills-thumb.jpg&quot; alt=&quot;hills&quot; rel=&quot;Hills Image&quot; /&gt;&lt;/a&gt;
		&lt;a href=&quot;lilies.jpg&quot;&gt;&lt;img src=&quot;lilies-thumb.jpg&quot; alt=&quot;lilies&quot; rel=&quot;Lilies Image&quot; /&gt;&lt;/a&gt;
		&lt;a href=&quot;sunset.jpg&quot;&gt;&lt;img src=&quot;sunset-thumb.jpg&quot; alt=&quot;sunset&quot; rel=&quot;Sunset Image&quot; /&gt;&lt;/a&gt;
		&lt;a href=&quot;winter.jpg&quot;&gt;&lt;img src=&quot;winter-thumb.jpg&quot; alt=&quot;winter&quot; rel=&quot;Winter Image&quot; /&gt;&lt;/a&gt;
		&lt;p id=&quot;large&quot;&gt;&lt;/p&gt;
   &lt;/div&gt;
   &lt;div id=&quot;large&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;background&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong><a href="http://blog.chapagain.com.np/examples/image-preview-grey-out/" target="_blank">View Demo</a> || <a href="http://chapagain.googlecode.com/files/image-preview-grey-out.zip" rel="nofollow"  target="_blank">Download Code</a></strong></p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=554&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-a-simple-tooltip/' rel='bookmark' title='Permanent Link: jQuery: A simple Tooltip'>jQuery: A simple Tooltip</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-set-time-interval-between-events-with-queue-function/' rel='bookmark' title='Permanent Link: jQuery: Set time interval between events with queue function'>jQuery: Set time interval between events with queue function</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>jQuery: Preview Image with Zoom Effect</title>
		<link>http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/</link>
		<comments>http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:10:41 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=551</guid>
		<description><![CDATA[Here, I will show you how to preview Image with Zoom effect. I mean, you will be able to preview large image when you hover the thumbnail image. The image is zoomed when hovered. View Demo &#124;&#124; Download Code As you can see below, I have kept the large image link in the alt tag. [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/' rel='bookmark' title='Permanent Link: jQuery: How to replace string, div content and image src?'>jQuery: How to replace string, div content and image src?</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-a-simple-slideshow/' rel='bookmark' title='Permanent Link: jQuery: A simple Slideshow'>jQuery: A simple Slideshow</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here, I will show you how to preview Image with Zoom effect. I mean, you will be able to preview large image when you hover the thumbnail image. The image is zoomed when hovered.</p>
<p><strong><a href="http://blog.chapagain.com.np/examples/image-preview-zoom/" target="_blank">View Demo</a> || <a href="http://chapagain.googlecode.com/files/image-preview-zoom.zip" rel="nofollow"  target="_blank">Download Code</a></strong></p>
<p><span id="more-551"></span></p>
<p>As you can see below, I have kept the large image link in the <em>alt</em> tag. The description/caption for the image is kept in <em>rel</em> tag.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;img src=&quot;hills-thumb.jpg&quot; alt=&quot;hills.jpg&quot; rel=&quot;Hills Image&quot; /&gt;
&lt;img src=&quot;lilies-thumb.jpg&quot; alt=&quot;lilies.jpg&quot; rel=&quot;Lilies Image&quot; /&gt;
&lt;img src=&quot;sunset-thumb.jpg&quot; alt=&quot;sunset.jpg&quot; rel=&quot;Sunset Image&quot; /&gt;
&lt;img src=&quot;winter-thumb.jpg&quot; alt=&quot;winter.jpg&quot; rel=&quot;Winter Image&quot; /&gt;
</pre>
<p>When the mouse is hovered over the image, I just have switched the <em>src</em> and <em>alt</em> tag&#8217;s value. Then the width of the image is increased by 30% with the animate function. Everything is brought back to normal (default state) when the cursor is taken away from the image.</p>
<p>The source of the image is changed before zoom, so that it is not blurred when zoomed with larged width.</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function() {
	var oldWidth = $(&quot;#thumbnail img&quot;).width();
	$(&quot;#thumbnail img&quot;).hover(function(){
		var src = $(this).attr(&quot;src&quot;);
		$(this).attr(&quot;src&quot;,$(this).attr(&quot;alt&quot;));
		$(this).animate({width: &quot;30%&quot;},1000);
		$(this).attr(&quot;alt&quot;,src);
	}, function(){
		$(this).animate({width: oldWidth},1000);
		var src = $(this).attr(&quot;src&quot;);
		$(this).queue(function(){
			$(this).attr(&quot;src&quot;,$(this).attr(&quot;alt&quot;));
			$(this).attr(&quot;alt&quot;,src);
			$(this).dequeue();
		});
	});
});
</pre>
<p>Here&#8217;s the full source code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;jQuery: Image Preview With Zoom Effect&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.4.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
	$(document).ready(function() {
		var oldWidth = $(&quot;#thumbnail img&quot;).width();
		$(&quot;#thumbnail img&quot;).hover(function(){
			var src = $(this).attr(&quot;src&quot;);
			$(this).attr(&quot;src&quot;,$(this).attr(&quot;alt&quot;));
			$(this).animate({width: &quot;30%&quot;},1000);
			$(this).attr(&quot;alt&quot;,src);
		}, function(){
			$(this).animate({width: oldWidth},1000);
			var src = $(this).attr(&quot;src&quot;);
			$(this).queue(function(){
				$(this).attr(&quot;src&quot;,$(this).attr(&quot;alt&quot;));
				$(this).attr(&quot;alt&quot;,src);
				$(this).dequeue();
			});
		});
	});
&lt;/script&gt;
&lt;style&gt;
img {
	border: none;
}
#thumbnail img {
	cursor: pointer;
	width: 100px;
	padding: 2px;
	float: left;
}
#large {
	display: none;
	position: absolute;
	color: #FFFFFF;
	background: #333333;
	padding: 5px;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;thumbnail&quot;&gt;
	&lt;h3&gt;Hover over the image&lt;/h3&gt;
	&lt;img src=&quot;hills-thumb.jpg&quot; alt=&quot;hills.jpg&quot; rel=&quot;Hills Image&quot; /&gt;
	&lt;img src=&quot;lilies-thumb.jpg&quot; alt=&quot;lilies.jpg&quot; rel=&quot;Lilies Image&quot; /&gt;
	&lt;img src=&quot;sunset-thumb.jpg&quot; alt=&quot;sunset.jpg&quot; rel=&quot;Sunset Image&quot; /&gt;
	&lt;img src=&quot;winter-thumb.jpg&quot; alt=&quot;winter.jpg&quot; rel=&quot;Winter Image&quot; /&gt;
	&lt;p id=&quot;large&quot;&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong><a href="http://blog.chapagain.com.np/examples/image-preview-zoom/" target="_blank">View Demo</a> || <a href="http://chapagain.googlecode.com/files/image-preview-zoom.zip" rel="nofollow"  target="_blank">Download Code</a></strong></p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=551&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/' rel='bookmark' title='Permanent Link: jQuery: How to replace string, div content and image src?'>jQuery: How to replace string, div content and image src?</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-a-simple-slideshow/' rel='bookmark' title='Permanent Link: jQuery: A simple Slideshow'>jQuery: A simple Slideshow</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery: Preview Image with Tooltip Effect</title>
		<link>http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/</link>
		<comments>http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 18:49:52 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[tooltip]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=548</guid>
		<description><![CDATA[Here, I will show you how to preview Image as a tooltip effect. I mean, you will be able to preview large image when you hover the thumbnail image. The preview is shown as tooltip is shown generally. View Demo &#124;&#124; Download Code As you can see in the js code, I have positioned the [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-a-simple-tooltip/' rel='bookmark' title='Permanent Link: jQuery: A simple Tooltip'>jQuery: A simple Tooltip</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/' rel='bookmark' title='Permanent Link: jQuery: How to replace string, div content and image src?'>jQuery: How to replace string, div content and image src?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here, I will show you how to preview Image as a tooltip effect. I mean, you will be able to preview large image when you hover the thumbnail image. The preview is shown as tooltip is shown generally.</p>
<p><strong><a href="http://blog.chapagain.com.np/examples/image-preview-tooltip/" target="_blank">View Demo</a> || <a href="http://chapagain.googlecode.com/files/image-preview-tooltip.zip" rel="nofollow"  target="_blank">Download Code</a></strong></p>
<p><span id="more-548"></span></p>
<p>As you can see in the js code, I have positioned the top and left for large image with <em>e.pageY</em> and <em>e.pageX</em>. Then, image is added with the img tag. After that, the image is displayed slowly with <em>fadeIn(&#8220;slow&#8221;)</em>. Large image is made hidden with <em>fadeOut </em>function when the cursor is moved away from the thumbnail image.</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function() {
	$(&quot;#thumbnail img&quot;).hover(function(e){
		$(&quot;#large&quot;).css(&quot;top&quot;,(e.pageY+5)+&quot;px&quot;)
			      .css(&quot;left&quot;, e.pageX+5)+&quot;px&quot;)
			      .html(&quot;&lt;img src=&quot;+ $(this).attr(&quot;alt&quot;) +&quot; alt='Large Image' /&gt;&lt;br/&gt;&quot;+$(this).attr(&quot;rel&quot;))
			      .fadeIn(&quot;slow&quot;);
	}, function(){
		$(&quot;#large&quot;).fadeOut(&quot;fast&quot;);
	});		

});
</pre>
<p>Here&#8217;s the full source code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;jQuery: Image Preview With Tooltip Effect&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.4.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
	$(document).ready(function() {
		$(&quot;#thumbnail img&quot;).hover(function(e){
			$(&quot;#large&quot;).css(&quot;top&quot;,(e.pageY+5)+&quot;px&quot;)
					.css(&quot;left&quot;,(e.pageX+5)+&quot;px&quot;)
					.html(&quot;&lt;img src=&quot;+ $(this).attr(&quot;alt&quot;) +&quot; alt='Large Image' /&gt;&lt;br/&gt;&quot;+$(this).attr(&quot;rel&quot;))
					.fadeIn(&quot;slow&quot;);
		}, function(){
			$(&quot;#large&quot;).fadeOut(&quot;fast&quot;);
		});		

	});
&lt;/script&gt;
&lt;style&gt;
img {
	border: none;
}
#thumbnail img {
	cursor: pointer;
}
#large {
	display: none;
	position: absolute;
	color: #FFFFFF;
	background: #333333;
	padding: 5px;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div align=&quot;center&quot;&gt;
   &lt;div id=&quot;thumbnail&quot;&gt;
		&lt;h3&gt;Hover over the image&lt;/h3&gt;
	    &lt;img src=&quot;hills-thumb.jpg&quot; alt=&quot;hills.jpg&quot; rel=&quot;Hills Image&quot; /&gt;
		&lt;img src=&quot;lilies-thumb.jpg&quot; alt=&quot;lilies.jpg&quot; rel=&quot;Lilies Image&quot; /&gt;
		&lt;img src=&quot;sunset-thumb.jpg&quot; alt=&quot;sunset.jpg&quot; rel=&quot;Sunset Image&quot; /&gt;
		&lt;img src=&quot;winter-thumb.jpg&quot; alt=&quot;winter.jpg&quot; rel=&quot;Winter Image&quot; /&gt;
		&lt;p id=&quot;large&quot;&gt;&lt;/p&gt;
   &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong><a href="http://blog.chapagain.com.np/examples/image-preview-tooltip/" target="_blank">View Demo</a> || <a href="http://chapagain.googlecode.com/files/image-preview-tooltip.zip" rel="nofollow"  target="_blank">Download Code</a></strong></p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=548&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-a-simple-tooltip/' rel='bookmark' title='Permanent Link: jQuery: A simple Tooltip'>jQuery: A simple Tooltip</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/' rel='bookmark' title='Permanent Link: jQuery: How to replace string, div content and image src?'>jQuery: How to replace string, div content and image src?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>jQuery: A simple Tooltip</title>
		<link>http://blog.chapagain.com.np/jquery-a-simple-tooltip/</link>
		<comments>http://blog.chapagain.com.np/jquery-a-simple-tooltip/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 18:23:06 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tooltip]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=545</guid>
		<description><![CDATA[Here, I will show you how to show tooltip with jQuery. It&#8217;s very simple and easy. I have a href link. I will show you, how to show tooltip when you hover your mouse over the link. The title of the href link will be shown as tooltip. View Demo &#124;&#124; Download Code In the [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-print-array-and-object/' rel='bookmark' title='Permanent Link: jQuery: Print array and object'>jQuery: Print array and object</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/' rel='bookmark' title='Permanent Link: jQuery: How to replace string, div content and image src?'>jQuery: How to replace string, div content and image src?</a></li>
<li><a href='http://blog.chapagain.com.np/simple-and-easy-jquery-tabs-with-ajax-and-php/' rel='bookmark' title='Permanent Link: Simple and easy jQuery tabs with AJAX and PHP'>Simple and easy jQuery tabs with AJAX and PHP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here, I will show you how to show tooltip with jQuery. It&#8217;s very simple and easy.</p>
<p>I have a href link. I will show you, how to show tooltip when you hover your mouse over the link. The title of the href link will be shown as tooltip.</p>
<p><strong><a href="http://blog.chapagain.com.np/examples/tooltip/" target="_blank">View Demo</a> || <a href="http://chapagain.googlecode.com/files/tooltip.zip" rel="nofollow"  target="_blank">Download Code</a></strong></p>
<p><span id="more-545"></span></p>
<p>In the demo, I have kept two links. One without tooltip and the other with tooltip.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;h2&gt;Tooltip&lt;/h2&gt;
&lt;a href=&quot;#&quot; title=&quot;Save Earth and Be Happy!&quot;&gt;Save the planet Earth&lt;/a&gt;&lt;br/&gt; (only with title but No tooltip)&lt;br/&gt;&lt;br/&gt;
&lt;a class=&quot;tooltip&quot; href=&quot;#&quot; title=&quot;Save Earth and Be Happy!&quot;&gt;Save the planet Earth&lt;/a&gt;&lt;br/&gt; (with tooltip)&lt;br/&gt;&lt;br/&gt;
&lt;p id=&quot;tip&quot;&gt;&lt;/p&gt;
</pre>
<p>Tooltip is shown when the link is hovered. The title of the href link is shown as tooltip. The tooltip position is set with e.PageY and e.PageX. The tooltip is shown slowly with fadeIn(&#8220;slow&#8221;). And the tooltip is made hidden with fadeOut(&#8220;fast&#8221;) when we don&#8217;t hover over the link or move the cursor away from the link.</p>
<pre class="brush: jscript; title: ; notranslate">
$(function(){
	var tip = $(&quot;#tip&quot;);

	$(&quot;a.tooltip&quot;).hover(function(e){

		// assign the &lt;a&gt; title to tip
		tip.text($(this).attr(&quot;title&quot;));

		// empty &lt;a&gt; title
		$(this).attr(&quot;title&quot;, &quot;&quot;);

		// set the position of tooltip and then display it
		tip.css(&quot;top&quot;,(e.pageY+5)+&quot;px&quot;)
		   .css(&quot;left&quot;,(e.pageX+5)+&quot;px&quot;)
		   .fadeIn(&quot;slow&quot;);

	}, function(){

		// hide tooltip
		$(&quot;#tip&quot;).fadeOut(&quot;fast&quot;);

		// set the &lt;a&gt; title with tootip content
		$(this).attr(&quot;title&quot;, tip.html());
	});
});
</pre>
<p><strong><a href="http://blog.chapagain.com.np/examples/tooltip/" target="_blank">View Demo</a> || <a href="http://chapagain.googlecode.com/files/tooltip.zip" rel="nofollow"  target="_blank">Download Code</a></strong></p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=545&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-print-array-and-object/' rel='bookmark' title='Permanent Link: jQuery: Print array and object'>jQuery: Print array and object</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/' rel='bookmark' title='Permanent Link: jQuery: How to replace string, div content and image src?'>jQuery: How to replace string, div content and image src?</a></li>
<li><a href='http://blog.chapagain.com.np/simple-and-easy-jquery-tabs-with-ajax-and-php/' rel='bookmark' title='Permanent Link: Simple and easy jQuery tabs with AJAX and PHP'>Simple and easy jQuery tabs with AJAX and PHP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/jquery-a-simple-tooltip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery: Cool Bouncing Navigation with easing plugin</title>
		<link>http://blog.chapagain.com.np/jquery-cool-bouncing-navigation-with-easing-plugin/</link>
		<comments>http://blog.chapagain.com.np/jquery-cool-bouncing-navigation-with-easing-plugin/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 14:17:34 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[bounce]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[easing]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=556</guid>
		<description><![CDATA[Here, I will be showing you how to create a cool bouncing navigation with jQuery and jQuery easing plugin. The content appears with the bouncing effect as you navigate through the menu. You need jQuery Library and the jQuery easing plugin. But you need not worry, I have zipped them all in the download file. [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/blogspot-how-to-hide-or-remove-blogger-top-navigation-bar/' rel='bookmark' title='Permanent Link: Blogspot: How to hide or remove Blogger top navigation bar?'>Blogspot: How to hide or remove Blogger top navigation bar?</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/making-a-tree-navigation-menu-in-php/' rel='bookmark' title='Permanent Link: Making a tree navigation menu in PHP'>Making a tree navigation menu in PHP</a></li>
<li><a href='http://blog.chapagain.com.np/simple-and-easy-jquery-tabs-with-ajax-and-php/' rel='bookmark' title='Permanent Link: Simple and easy jQuery tabs with AJAX and PHP'>Simple and easy jQuery tabs with AJAX and PHP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here, I will be showing you how to create a cool bouncing navigation with jQuery and jQuery easing plugin. The content appears with the bouncing effect as you navigate through the menu.</p>
<p>You need jQuery Library and the jQuery easing plugin. But you need not worry, I have zipped them all in the download file.</p>
<p><span id="more-556"></span></p>
<p><strong><a href="http://blog.chapagain.com.np/examples/bouncing-navigation/"target="_blank" >View Demo</a> || <a href="http://chapagain.googlecode.com/files/bouncing-navigation.zip" rel="nofollow" target="_blank" >Download Code</a></strong></p>
<p>Basically, there are 3 parts &#8211; CSS, HTML and Javascript.</p>
<p>Here is the HTML part:-</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;container&quot; align=&quot;center&quot;&gt;
	&lt;h2&gt;Bouncing Navigation&lt;/h2&gt;

	&lt;div id=&quot;navigation&quot;&gt;
		&lt;a class=&quot;home&quot; href=&quot;#&quot;&gt;Home&lt;/a&gt;
		&lt;a class=&quot;contact&quot; href=&quot;#&quot;&gt;Contact&lt;/a&gt;
		&lt;a class=&quot;links&quot; href=&quot;#&quot;&gt;Links&lt;/a&gt;
		&lt;a class=&quot;about&quot; href=&quot;#&quot;&gt;About&lt;/a&gt;
	&lt;/div&gt;
	&lt;br/&gt;

	&lt;div class=&quot;content home&quot;&gt;&lt;h3&gt;Home&lt;/h3&gt;&lt;/div&gt;
	&lt;div class=&quot;content contact hide&quot;&gt;&lt;h3&gt;Contact&lt;/h3&gt;&lt;/div&gt;
	&lt;div class=&quot;content links hide&quot;&gt;&lt;h3&gt;Links&lt;/h3&gt;&lt;/div&gt;
	&lt;div class=&quot;content about hide&quot;&gt;&lt;h3&gt;About&lt;/h3&gt;&lt;/div&gt;		

&lt;/div&gt;
&lt;div style=&quot;border-bottom: 1px solid #CCCCCC&quot;&gt;&lt;/div&gt;
</pre>
<p>In the HTML part, the div with id=navigation contains menus. And the div with the class=content contains the content data related with each menu. By default, only the home content is shown. The rest of others are made hidden. </p>
<p>The displaying, hiding, padding, maintaining width, height, font color, background color, etc. are controlled by CSS. Here is the CSS part:-</p>
<pre class="brush: css; title: ; notranslate">
#container {
	padding: 10px;
	min-height: 350px;
}
#navigation a {
	text-decoration: none;
	padding: 10px;
	color: #F3F3F3;
}
#navigation a:hover {
	text-decoration: underline;
}
.home {
	background: #0292C0;
}
.contact {
	background: #6AA63B;
}
.links {
	background: #D52100;
}
.about {
	background: #FBC700;
}
.content {
	border: 1px solid #336699;
	width: 300px;
	height: 300px;
	padding: 10px;
	color: #F3F3F3;
}
.hide {
	display: none;
}
</pre>
<p>The bouncing effect is performed through Javascript.</p>
<pre class="brush: jscript; title: ; notranslate">
$(function(){
	$(&quot;#navigation a&quot;).click(function(){
		$(&quot;.content.&quot;+$(this).attr(&quot;class&quot;)).animate({height: &quot;1px&quot;},50);
		$(&quot;[class^=content]&quot;).addClass(&quot;hide&quot;);
		$(&quot;[class^=content]&quot;).removeAttr(&quot;style&quot;);
		$(&quot;.content.&quot;+$(this).attr(&quot;class&quot;)).animate({height: &quot;300px&quot;},{duration: 1000, easing: &quot;easeOutBounce&quot;});
	});
});
</pre>
<p>In the JS code above, the effect is performed when the <strong>a href</strong> link of div id=navigation is clicked. Here are the steps performed:-<br />
    &#8211; make the height of content to 1px with <strong>animate </strong>function.<br />
    &#8211; add class <strong>hide</strong> to all div with class <strong>content</strong><br />
    &#8211; remove <strong>style </strong>attribute from the div with class <strong>content</strong><br />
    &#8211; animate the div <strong>content </strong>to the height 300px with <strong>easeOutBounce </strong>effect (This effect is one of the effects of jQuery easing plugin. This gives the bouncing effect.)</p>
<p>That&#8217;s all we need for the cool bouncing navigation effect.</p>
<p><strong><a href="http://blog.chapagain.com.np/examples/bouncing-navigation/"target="_blank" >View Demo</a> || <a href="http://chapagain.googlecode.com/files/bouncing-navigation.zip" rel="nofollow" target="_blank" >Download Code</a></strong></p>
<p>Cheers,</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=556&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/blogspot-how-to-hide-or-remove-blogger-top-navigation-bar/' rel='bookmark' title='Permanent Link: Blogspot: How to hide or remove Blogger top navigation bar?'>Blogspot: How to hide or remove Blogger top navigation bar?</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/making-a-tree-navigation-menu-in-php/' rel='bookmark' title='Permanent Link: Making a tree navigation menu in PHP'>Making a tree navigation menu in PHP</a></li>
<li><a href='http://blog.chapagain.com.np/simple-and-easy-jquery-tabs-with-ajax-and-php/' rel='bookmark' title='Permanent Link: Simple and easy jQuery tabs with AJAX and PHP'>Simple and easy jQuery tabs with AJAX and PHP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/jquery-cool-bouncing-navigation-with-easing-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery: Animate and Transfer effect with Image</title>
		<link>http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/</link>
		<comments>http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 10:40:41 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[fade]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[transfer]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=530</guid>
		<description><![CDATA[I have created a bit of image animation with the Transfer effect of jQuery UI. By animation, I just mean fade in and out. But the transfer effect makes it so beautiful :). The Transfer effect can be used with effect() method. This Transfers the outline of an element to another element. Very useful when [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/' rel='bookmark' title='Permanent Link: jQuery: How to replace string, div content and image src?'>jQuery: How to replace string, div content and image src?</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-a-simple-slideshow/' rel='bookmark' title='Permanent Link: jQuery: A simple Slideshow'>jQuery: A simple Slideshow</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I have created a bit of image animation with the <strong>Transfer effect</strong> of <strong>jQuery UI</strong>. By animation, I just mean fade in and out. But the transfer effect makes it so beautiful :). </p>
<blockquote><p>The Transfer effect can be used with effect() method. This Transfers the outline of an element to another element. Very useful when trying to visualize interaction between two elements.</p></blockquote>
<p><span id="more-530"></span></p>
<p>With the animate() method, I have just changed the opacity of the image. When you click the thumbnail or large image, then you can see the Transfer effect working. The images are changed with some fade in and out.</p>
<p><strong><a href="http://blog.chapagain.com.np/examples/transfer/"target="_blank" >View Demo</a> || <a href="http://chapagain.googlecode.com/files/jquery-transfer-image.zip" rel="nofollow" target="_blank" >Download Code</a></strong></p>
<p>I have well commented the code for better understanding. Here is the full source code:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Image transfer&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.4.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-ui-1.7.2.custom.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
	$(document).ready(function() {
		/**
		 *	Using transfer effect when large image is clicked
		 */
		$(&quot;.large&quot;).click(function () {
			var thumbRel = $(this).attr(&quot;rel&quot;);
			$(this).effect(&quot;transfer&quot;,{ to: $(&quot;.thumbnail img[rel='&quot;+thumbRel+&quot;']&quot;) }, 1000);
		});

		/**
		 * Using transfer effect when thumbnail image is clicked
		 */
		$(&quot;.thumb&quot;).click(function () {
			/**
			 * Remove class 'current' if exists
			 */
			$(&quot;.thumbnail [class^='thumb']&quot;).removeClass(&quot;current&quot;);

			/**
			 * Add class 'current' to highlight the selected thumbnail image
			 */
			$(this).addClass(&quot;current&quot;);

			/**
			 * Change the 'rel' of large image with that of the thumbnail image
			 */
			$(&quot;.large&quot;).attr(&quot;rel&quot;, $(this).attr(&quot;rel&quot;));				

			/**
			 * Use transfer effect
			 */
			$(this).effect(&quot;transfer&quot;,{ to: $(&quot;.large&quot;) }, 1000);

			/**
			 * Fade out the current large image
			 */
			$(&quot;.large&quot;).animate({opacity: 0.3}, 1000);

			/**
			 * The functions inside queue() is used after the above animate and other functions get completed
			 */
			$(this).queue(function(){
				/**
				 * Change the src of large image
				 * Here, thumb image is hills-thumb.jpg then large image is hills.jpg
				 */
				$(&quot;.large&quot;).attr(&quot;src&quot;, $(this).attr(&quot;src&quot;).replace(&quot;-thumb&quot;, &quot;&quot;));

				/**
				 * Fade in the large image
				 */
				$(&quot;.large&quot;).animate({opacity: 1}, 1000);
				$(this).dequeue();
			});
		});
	});
&lt;/script&gt;
&lt;style&gt;
	.main {
		padding: 4px;
		position: relative;
	}
	.thumbnail {
		padding: 10px;
		position: relative;
	}
	.thumbnail .thumb {
		padding: 2px;
	}
	.current {
		border: 1px solid red;
	}
	.ui-effects-transfer {
		border: 2px solid black;
	}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div align=&quot;center&quot;&gt;
   &lt;p&gt;&lt;strong&gt;Click thumbnail or large image:&lt;/strong&gt;&lt;/p&gt;
   &lt;div class=&quot;main&quot;&gt;
		&lt;img class=&quot;large&quot; src=&quot;hills.jpg&quot; alt=&quot;image&quot; rel=&quot;hills&quot; /&gt;
   &lt;/div&gt;
   &lt;div class=&quot;thumbnail&quot;&gt;
	   &lt;img class=&quot;thumb&quot; src=&quot;hills-thumb.jpg&quot; alt=&quot;image&quot; rel=&quot;hills&quot; /&gt;
	   &lt;img class=&quot;thumb&quot; src=&quot;lilies-thumb.jpg&quot; alt=&quot;image&quot; rel=&quot;lilies&quot; /&gt;
	   &lt;img class=&quot;thumb&quot; src=&quot;sunset-thumb.jpg&quot; alt=&quot;image&quot; rel=&quot;sunset&quot; /&gt;
	   &lt;img class=&quot;thumb&quot; src=&quot;winter-thumb.jpg&quot; alt=&quot;image&quot; rel=&quot;winter&quot; /&gt;
   &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong><a href="http://blog.chapagain.com.np/examples/transfer/"target="_blank" >View Demo</a> || <a href="http://chapagain.googlecode.com/files/jquery-transfer-image.zip" rel="nofollow" target="_blank" >Download Code</a></strong></p>
<p>Cheers,</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=530&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/' rel='bookmark' title='Permanent Link: jQuery: How to replace string, div content and image src?'>jQuery: How to replace string, div content and image src?</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-a-simple-slideshow/' rel='bookmark' title='Permanent Link: jQuery: A simple Slideshow'>jQuery: A simple Slideshow</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery: A simple Slideshow</title>
		<link>http://blog.chapagain.com.np/jquery-a-simple-slideshow/</link>
		<comments>http://blog.chapagain.com.np/jquery-a-simple-slideshow/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 10:41:42 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[fade]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[queue]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[timeout]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=528</guid>
		<description><![CDATA[I have made a very simple jQuery slideshow. When you click the play button, then the images changes with fade in and fade out effect. View Demo &#124;&#124; Download Code I have used animate() jQuery function for fade in and out. queue() and dequeue() functions along with setTimeout() function are used to set time interval [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-set-time-interval-between-events-with-queue-function/' rel='bookmark' title='Permanent Link: jQuery: Set time interval between events with queue function'>jQuery: Set time interval between events with queue function</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-print-array-and-object/' rel='bookmark' title='Permanent Link: jQuery: Print array and object'>jQuery: Print array and object</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I have made a very simple jQuery slideshow. When you click the play button, then the images changes with fade in and fade out effect. </p>
<p><strong><a href="http://blog.chapagain.com.np/examples/slideshow1/"target="_blank" >View Demo</a> || <a href="http://chapagain.googlecode.com/files/jquery-image-slideshow1.zip" rel="nofollow" target="_blank" >Download Code</a></strong></p>
<p><span id="more-528"></span></p>
<p>I have used animate() jQuery function for fade in and out. queue() and dequeue() functions along with setTimeout() function are used to set time interval between fade in and fade out. The images are stored in javascript array.</p>
<p>I have well commented the code so that it would be easy to understand. Here comes the full source code.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;jQuery: Slideshow&lt;/title&gt;
&lt;script src=&quot;jquery-1.4.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	$(function(){
		/**
		 * Array of images
		 */
		var arr = [ &quot;hills.jpg&quot;, &quot;lilies.jpg&quot;, &quot;sunset.jpg&quot;, &quot;winter.jpg&quot;, &quot;slideshow.jpg&quot; ];

		/**
		 * When play button is clicked
		 */
		$(&quot;#play&quot;).click(function(){
			/**
			 * Foreach loop
			 */
			$.each(arr, function(i, val) {
				/**
				 * Changing div opacity to 0. 1000 is the time in ms.
				 */
				$(&quot;#sImage&quot;).animate({opacity: 0.0}, 1000);
				/**
				 * Queue function will place the event in queue
				 * Changing image src after the above animate function is completed
				 */
				$(&quot;#sImage&quot;).queue(function(){
					$(&quot;#sImage&quot;).attr(&quot;src&quot;, val);
					$(&quot;#sImage&quot;).dequeue();
				});
				/**
				 * Changing div opacity to 1. 1000 is the time in ms.
				 */
				$(&quot;#sImage&quot;).attr(&quot;src&quot;, val).animate({opacity: 1.0}, 1000);
				/**
				 * Queue function will place the event in queue
				 * Here, queue function is used to hold the changing image for 1 second display
				 */
				$(&quot;#sImage&quot;).queue(function(){
					setTimeout(function(){
						$(&quot;#sImage&quot;).dequeue();
					}, 1000);
				});
			});
		});
	});
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div align=&quot;center&quot;&gt;
	&lt;button id=&quot;play&quot;&gt; Play &lt;/button&gt;
	&lt;div class=&quot;slideshow&quot;&gt;
		&lt;img id=&quot;sImage&quot; src=&quot;slideshow.jpg&quot; alt=&quot;slideshow&quot; rel=&quot;slideshow&quot; /&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong><a href="http://blog.chapagain.com.np/examples/slideshow1/"target="_blank" >View Demo</a> || <a href="http://chapagain.googlecode.com/files/jquery-image-slideshow1.zip" rel="nofollow" target="_blank" >Download Code</a></strong></p>
<p>Cheers,</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=528&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-set-time-interval-between-events-with-queue-function/' rel='bookmark' title='Permanent Link: jQuery: Set time interval between events with queue function'>jQuery: Set time interval between events with queue function</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-print-array-and-object/' rel='bookmark' title='Permanent Link: jQuery: Print array and object'>jQuery: Print array and object</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/jquery-a-simple-slideshow/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQuery: How to replace string, div content and image src?</title>
		<link>http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/</link>
		<comments>http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 05:05:51 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=526</guid>
		<description><![CDATA[In this article, I will be showing you how you can replace string, div content, and image src value with jQuery. You can do this by replace() function in jQuery. View Demo &#124;&#124; Download Code Here is the code to replace string. This will replace the &#8216;smile&#8217; text with &#8216;be happy&#8217;. Here is the code [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-a-simple-slideshow/' rel='bookmark' title='Permanent Link: jQuery: A simple Slideshow'>jQuery: A simple Slideshow</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In this article, I will be showing you how you can replace string, div content, and image src value with jQuery.</p>
<p>You can do this by <strong>replace()</strong> function in jQuery.</p>
<p><span id="more-526"></span></p>
<p><strong><a href="http://blog.chapagain.com.np/examples/replace/"target="_blank" >View Demo</a> || <a href="http://chapagain.googlecode.com/files/jquery-replace-string.zip" rel="nofollow" target="_blank" >Download Code</a></strong></p>
<p>Here is the code to replace string. This will replace the &#8216;smile&#8217; text with &#8216;be happy&#8217;.</p>
<pre class="brush: jscript; title: ; notranslate">
var oldText = &quot;Save Earth and smile!&quot;;
var newText = oldText.replace(&quot;smile&quot;, &quot;be happy&quot;);
</pre>
<p>Here is the code to replace image src. The following code replaces &#8216;hills&#8217; with &#8216;sunset&#8217;.</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;.img&quot;).attr(&quot;src&quot;).replace(&quot;hills&quot;, &quot;sunset&quot;);
</pre>
<p>Here is the code to replace div content. The following code replaces the text &#8216;First&#8217; with &#8216;This is the first&#8217;.</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;#one&quot;).text().replace(&quot;First&quot;, &quot;This is the first&quot;);
</pre>
<p>Here is the full source code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;jQuery: Replace&lt;/title&gt;
&lt;script src=&quot;jquery-1.4.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	$(function(){
		$(&quot;#change&quot;).click(function(){
			var newSrc = $(&quot;.img&quot;).attr(&quot;src&quot;).replace(&quot;hills&quot;, &quot;sunset&quot;);
			$(&quot;.img&quot;).attr(&quot;src&quot;, newSrc);			

			var oneDiv = $(&quot;#one&quot;).text().replace(&quot;First&quot;, &quot;This is the first&quot;);
			$(&quot;#one&quot;).text(oneDiv);

			var oldText = &quot;Save Earth and smile!&quot;;
			var newText = oldText.replace(&quot;smile&quot;, &quot;be happy&quot;);
			$(&quot;#two&quot;).text(newText);
		});

		$(&quot;#refresh&quot;).click(function(){
			location.reload();
		});

	});
&lt;/script&gt;
&lt;style&gt;
	#one {
		border: 1px solid #CCCCCC;
		margin: 10px;
		width: 300px;
	}
	#two {
		border: 1px solid #CCCCCC;
		margin: 10px;
		width: 300px;
	}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div align=&quot;center&quot;&gt;
	&lt;img class=&quot;img&quot; src=&quot;hills-thumb.jpg&quot; alt=&quot;image&quot; /&gt;

	&lt;div id=&quot;one&quot;&gt;
	First div.
	&lt;/div&gt;

	&lt;div id=&quot;two&quot;&gt;
	Second div.
	&lt;/div&gt;

	&lt;button id=&quot;change&quot;&gt; Change &lt;/button&gt;
	&lt;button id=&quot;refresh&quot;&gt; Refresh &lt;/button&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong><a href="http://blog.chapagain.com.np/examples/replace/"target="_blank" >View Demo</a> || <a href="http://chapagain.googlecode.com/files/jquery-replace-string.zip" rel="nofollow" target="_blank" >Download Code</a></strong></p>
<p>Cheers,</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=526&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-animate-and-transfer-effect-with-image/' rel='bookmark' title='Permanent Link: jQuery: Animate and Transfer effect with Image'>jQuery: Animate and Transfer effect with Image</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-tooltip-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Tooltip Effect'>jQuery: Preview Image with Tooltip Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-preview-image-with-zoom-effect/' rel='bookmark' title='Permanent Link: jQuery: Preview Image with Zoom Effect'>jQuery: Preview Image with Zoom Effect</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-a-simple-slideshow/' rel='bookmark' title='Permanent Link: jQuery: A simple Slideshow'>jQuery: A simple Slideshow</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/jquery-how-to-replace-string-div-content-and-image-src/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
