<?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>Php Development &#187; jquery</title>
	<atom:link href="http://www.maheshchari.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maheshchari.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 17 Jan 2012 02:42:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>jQuery form validation example required</title>
		<link>http://www.maheshchari.com/jquery-form-validation-example-required/</link>
		<comments>http://www.maheshchari.com/jquery-form-validation-example-required/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 12:58:43 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=699</guid>
		<description><![CDATA[// jQuery form validation &#8220;required&#8221; example 1 &#8220;required&#8221; element with HTML &#160; bind simple function by adding simple class to required elements &#8220;required&#8221;. $&#40;'#form1'&#41;.validate&#40;&#41;; jQuery form validation &#8220;required&#8221; example 1 &#8220;required&#8221; element with Javascript parameters &#160; bind function by adding configuration with Javascript only.Here we add custom messages also. $&#40;'#form2'&#41;.validate&#40;&#123; rules:&#123; username2:'required', password2:'required' &#125; ,messages:&#123; [...]]]></description>
			<content:encoded><![CDATA[<p><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.js"></script><br />
<script type="text/javascript">// <![CDATA[
 jQuery().ready(function (){  jQuery('#form1').validate(); jQuery('#form2').validate({ rules:{ 	username2:'required', 	password2:'required' } ,messages:{ 	username2:"Please enter user name.", 	password2:"Please enter password" 	} }); });
// ]]&gt;</script></p>
<h2>jQuery form validation &#8220;required&#8221; example 1</h2>
<h3>&#8220;required&#8221; element with HTML</h3>
<table>
<tbody>
<tr>
<td>
<form id="form1" method="post">
<input id="username" class="required" name="username" type="text" />
<input id="password" class="required" name="password" type="text" />
<input id="button" name="button" type="submit" value="Submit" />
<p>&nbsp;</p>
</form>
</td>
<td>bind simple function by adding simple class to required elements &#8220;required&#8221;.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#form1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</td>
</tr>
</tbody>
</table>
<h2>jQuery form validation &#8220;required&#8221; example 1</h2>
<h3>&#8220;required&#8221; element with Javascript parameters</h3>
<table>
<tbody>
<tr>
<td>
<form id="form2" method="post">
<input id="username2" name="username2" type="text" />
<input id="password2" name="password2" type="text" />
<input id="button2" name="button2" type="submit" value="Submit" />
<p>&nbsp;</p>
</form>
</td>
<td>bind function by adding configuration with Javascript only.Here we add custom messages also.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#form2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
rules<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
	username2<span style="color: #339933;">:</span><span style="color: #3366CC;">'required'</span><span style="color: #339933;">,</span>
	password2<span style="color: #339933;">:</span><span style="color: #3366CC;">'required'</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">,</span>messages<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
	username2<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Please enter user name.&quot;</span><span style="color: #339933;">,</span>
	password2<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Please enter password&quot;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=699&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/jquery-form-validation-example-required/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery form validation</title>
		<link>http://www.maheshchari.com/jquery-form-validation/</link>
		<comments>http://www.maheshchari.com/jquery-form-validation/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 21:06:21 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=694</guid>
		<description><![CDATA[jQuery form validation Hello freinds, we know that every dynamic form need to be proper validated through the server and client side. some one get the doubt why we need to be implemented on both client and server side. as per my opinion we just need Server side validation only, but it takes more server [...]]]></description>
			<content:encoded><![CDATA[<h1>jQuery form validation </h1>
<p>Hello freinds, we know that every dynamic form need to be proper validated through the server and client side. some one get the doubt why we need to be implemented on both client and server side. as per my opinion we just need Server side validation only, but it takes more server resources and requests if user doesn&#8217;t submit the data correctly . some one will get question why we can only implment client side validation , i say NO for only client side validation because some users will disable javascript and send the data to server in that case it is useless to implment only client side validation. It is good practice to implement both client and server side validation . </p>
<p>I have created a long <a href="http://www.maheshchari.com/60-validation-functions-with-php/">validation class</a> for PHP and posted in my previous tutorial. now we are going to learn how to implement the client side valdiation with jQuery . for that we have a good <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" target="_blank">jQuery validation plug in</a> , that can be used in many ways. you can see the examples <a href="http://jquery.bassistance.de/validate/demo/" target="_blank">here</a>.</p>
<p>&nbsp;</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=694&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/jquery-form-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>horizontal scroll</title>
		<link>http://www.maheshchari.com/horizontal-scroll/</link>
		<comments>http://www.maheshchari.com/horizontal-scroll/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 21:28:19 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[scroll]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=672</guid>
		<description><![CDATA[how to scroll the window horizontally scroll? I got asked by my coleague to horizontal scroll the window , let me explain the scenario , page width is 1500px with a 1500px image in back ground and it should be always centered on page load and window resized. i got a solution thanx to jQuery.scrollTo [...]]]></description>
			<content:encoded><![CDATA[<h1>how to scroll the window horizontally scroll?<br />
</h1>
<p>I got asked by my coleague to horizontal scroll the window , let me explain the scenario  , page width is 1500px with a 1500px image in back ground and it should be always centered on page load and window resized. i got a solution thanx to<a href="http://demos.flesler.com/jquery/scrollTo/" target="_blank" rel="nofollow"> jQuery.scrollTo plugin</a>. </p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;how to center the window for small screen&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-1.6.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.scrollTo-min.js&quot;&gt;&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
#container {
	width: 1500px;
	border: 1px solid #333;
	min-height:500px;
	margin:0 auto;
	text-align:center;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;container&quot;&gt;
  &lt;h1&gt;This container has 1500px width  and centered into the view port.&lt;/h1&gt;
  &lt;h2&gt; if this container is seen in less than 1500px  ,&lt;/h2&gt;
  &lt;h3&gt; it should be scrolled to the centered on&lt;/h3&gt;
  &lt;h4&gt;page initializes and window resizes&lt;/h4&gt;
&lt;/div&gt;
&lt;script&gt;
$().ready(function(){
$.scrollTo('50%',{axis:'x'});
$(window).resize(function(){$.scrollTo('50%',{axis:'x'});});
});
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<h2><a href='http://www.maheshchari.com/wp-content/uploads/2011/07/horiz.zip'>Demo</a></h2>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=672&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/horizontal-scroll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>draw eclipse using javascript</title>
		<link>http://www.maheshchari.com/draw-eclipse-using-javascript/</link>
		<comments>http://www.maheshchari.com/draw-eclipse-using-javascript/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 21:42:13 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=592</guid>
		<description><![CDATA[How to draw eclipse using HTML4,CSS2,jQuery Please refer my previous post draw circle ,to get basic idea. Circle is instance of an Eclipse where both xradius and yradius are equal. See the quick demo how it works and looks here. Here is the idea how we get the points on Eclipse using trigonametry. You can [...]]]></description>
			<content:encoded><![CDATA[<h1>How to draw eclipse using HTML4,CSS2,jQuery</h1>
<p>Please refer my <a href="http://www.maheshchari.com/draw-circle-with-javascript/" target="_blank">previous post</a> draw circle ,to get basic idea. <strong>Circle</strong> is instance of an <strong>Eclipse</strong> where both <strong>xradius</strong> and <strong>yradius</strong> are equal. </p>
<p>See the quick <a href="http://demo.maheshchari.com/draweclipse/example3.html" target="_blank"><strong>demo</strong></a> how it works and looks here.</p>
<p>Here is the idea how we get the points on <strong>Eclipse</strong> using trigonametry. You can apply this formula to any programming language.</p>
<p>x=centerX+Xradius*Math.sin(angle);<br />
y=centerY+Yradius*Math.cos(angle );</p>
<p>Here is the function that will return the array of points exists on Eclipse. It will take five parameters ,<strong>centerx</strong>,<strong>centery</strong> , <strong>xradius</strong>,<strong>yradius</strong>,number of <strong>points</strong> we need.
</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> getCirclePoints<span style="color: #009900;">&#40;</span>centerX<span style="color: #339933;">,</span>centerY<span style="color: #339933;">,</span>xradius<span style="color: #339933;">,</span>yradius<span style="color: #339933;">,</span>segments<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> totalPoints<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #009900;">&#40;</span>segments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
x<span style="color: #339933;">=</span>centerX<span style="color: #339933;">+</span>xradius<span style="color: #339933;">*</span>Math.<span style="color: #660066;">sin</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">*</span><span style="color: #CC0000;">2</span><span style="color: #339933;">*</span>Math.<span style="color: #660066;">PI</span><span style="color: #339933;">/</span>segments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
y<span style="color: #339933;">=</span>centerY<span style="color: #339933;">+</span>yradius<span style="color: #339933;">*</span>Math.<span style="color: #660066;">cos</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">*</span><span style="color: #CC0000;">2</span><span style="color: #339933;">*</span>Math.<span style="color: #660066;">PI</span><span style="color: #339933;">/</span>segments <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
totalPoints.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'x'</span><span style="color: #339933;">:</span>x<span style="color: #339933;">,</span><span style="color: #3366CC;">'y'</span><span style="color: #339933;">:</span>y<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">return</span> totalPoints<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><a href="http://demo.maheshchari.com/draweclipse/example3.html" target="_blank"><strong>Demo</strong></a></p>
<p>Animation Effect with above function</p>
<p><a href="http://demo.maheshchari.com/draweclipse/example2.html" target="_blank"><strong>Animation Demo</strong></a></p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=592&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/draw-eclipse-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>draw circle with javascript</title>
		<link>http://www.maheshchari.com/draw-circle-with-javascript/</link>
		<comments>http://www.maheshchari.com/draw-circle-with-javascript/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 21:21:40 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=584</guid>
		<description><![CDATA[How to draw a Circle using HTML 4, CSS2,Javascript ,jQuery here we learn how to draw a basic circle with HTML div, CSS2, jQuery . Basic concept behind this scenario is Maths . We must know some basic circle equation to find the x, y co ordintates of the cicle perimeter. any point on circle [...]]]></description>
			<content:encoded><![CDATA[<h2>How to draw a Circle using HTML 4, CSS2,Javascript ,jQuery</h2>
<p>here we learn how to draw a basic circle with HTML div, CSS2, jQuery . Basic concept behind this scenario is Maths . </p>
<p>We must know some basic circle equation to find the x, y co ordintates of the cicle perimeter. any point on circle can be denoted as trigonametry equation as shown below. here Javascript function accepts in radians. next how many points we need to draw the circle ,we can draw as many points we want. </p>
<p>Concept : </p>
<p>x=centerX+radius*Math.sin(angle);<br />
  y=centerY+radius*Math.cos(angle);</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> getCirclePoints<span style="color: #009900;">&#40;</span>centerX<span style="color: #339933;">,</span>centerY<span style="color: #339933;">,</span>radius<span style="color: #339933;">,</span>segments<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> totalPoints<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>segments<span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
x<span style="color: #339933;">=</span>centerX<span style="color: #339933;">+</span>radius<span style="color: #339933;">*</span>Math.<span style="color: #660066;">sin</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">*</span><span style="color: #CC0000;">2</span><span style="color: #339933;">*</span>Math.<span style="color: #660066;">PI</span><span style="color: #339933;">/</span>segments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
y<span style="color: #339933;">=</span>centerY<span style="color: #339933;">+</span>radius<span style="color: #339933;">*</span>Math.<span style="color: #660066;">cos</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">*</span><span style="color: #CC0000;">2</span><span style="color: #339933;">*</span>Math.<span style="color: #660066;">PI</span><span style="color: #339933;">/</span>segments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
totalPoints.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'x'</span><span style="color: #339933;">:</span>x<span style="color: #339933;">,</span><span style="color: #3366CC;">'y'</span><span style="color: #339933;">:</span>y<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">return</span> totalPoints<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>&nbsp;</p>
<p>In the above function we decide how many points or segments we need. we should give radius and center point of the circle. </p>
<h2><a href="http://demo.maheshchari.com/drawcircle/example.html">Click Demo how it works instntly.</a></h2>
<h2><a href="http://demo.maheshchari.com/drawcircle/example1.html">See the animation effect with above function</a></h2>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=584&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/draw-circle-with-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>detect user is active or idle on web page</title>
		<link>http://www.maheshchari.com/detect-user-is-active-or-idle-on-web-page/</link>
		<comments>http://www.maheshchari.com/detect-user-is-active-or-idle-on-web-page/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 04:16:03 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=563</guid>
		<description><![CDATA[How to find the user is idle or active on web page or its element. We know that user is active on our web page or any element of the web page when he performs following actions Mouse Moves Key board button presses (presse down or up) Mouse Wheel or Mouse Scrolls Mouse Down ( [...]]]></description>
			<content:encoded><![CDATA[<h2>How to find the user is idle or active on web page or its element.</h2>
<p><img src="http://www.maheshchari.com/wp-content/uploads/2010/11/idletimer.jpg" alt="" title="How to detect the user idle activity on web page using jquery" width="500" height="271" class="aligncenter size-full wp-image-566" /></p>
<p>We know that user is active on our web page or any element of the web page when he performs following actions </p>
<ul>
<li>Mouse Moves</li>
<li>Key board button presses (presse down or up) </li>
<li>Mouse Wheel or Mouse Scrolls</li>
<li>Mouse Down ( click)  </li>
</ul>
<p>When the user doesn&#8217;t do any of above action on web page ,he is idle or in active. </p>
<p>Here we group above events as <strong>user active events</strong> and other one event that is user <strong>idle Event</strong>. let consider user is idle for a certain time if he doesn&#8217;t any user events ,<strong>10 seconds</strong> .</p>
<p>The logic is here very simple we bind a timer event that is called <strong>idle event</strong> ,it will called 10seconds. </p>
<p>If we user performs any above user active events ,we post pone the <strong>idle event</strong> for next 10seconds. </p>
<p>If he doesn&#8217;t do any thing for 10seconds the idle event automatically called by<strong> timer event</strong>. </p>
<p>We test on following Element with jQuery. </p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> timer<span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">// a timer event</span>
<span style="color: #003366; font-weight: bold;">var</span> idleTime<span style="color: #339933;">=</span><span style="color: #CC0000;">3000</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//ms</span>
<span style="color: #006600; font-style: italic;">//this function post pones calling userIdle function for next 10 Seconds</span>
<span style="color: #003366; font-weight: bold;">function</span> userActive<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
clearTimeout<span style="color: #009900;">&#40;</span>timer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//resent the timer </span>
timer<span style="color: #339933;">=</span>setTimeout<span style="color: #009900;">&#40;</span>userIdle<span style="color: #339933;">,</span>idleTime<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//again post pone user Idle function</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#ObserverElement'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Glad to see you again !!'</span><span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">trigger</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">// trigger a custome event that is user active</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> userIdle<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#ObserverElement'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Oops!! user in active !!'</span><span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">trigger</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'idle'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">// trigger a custom event that is user is idle.</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#ObserverElement'</span><span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mousemove'</span><span style="color: #339933;">,</span>userActive<span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'keydown'</span><span style="color: #339933;">,</span>userActive<span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DOMMouseScroll'</span><span style="color: #339933;">,</span>userActive<span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mousewheel'</span><span style="color: #339933;">,</span>userActive<span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mousedown'</span><span style="color: #339933;">,</span>userActive<span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//if user comes active again we change back ground color</span>
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'background-color'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'#FFFF00'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'idle'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">//if user go in active or idel we change back ground color</span>
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'background-color'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'#CCFF00'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2><a href='http://www.maheshchari.com/wp-content/uploads/2010/11/idletime.zip'>Download Demo</a></h2>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=563&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/detect-user-is-active-or-idle-on-web-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery multiple instances</title>
		<link>http://www.maheshchari.com/jquery-multiple-instances/</link>
		<comments>http://www.maheshchari.com/jquery-multiple-instances/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 00:47:32 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=532</guid>
		<description><![CDATA[jQuery multiple instances here we learn how to apply our jQuery plug in for each element with our plugin instance . by default JavaScript assumes each variable and object are static, if you change any where it remains stateless. To understand this code we must aware of JavaScript scope of variables. jquery basics. Download Demo [...]]]></description>
			<content:encoded><![CDATA[<h1>jQuery multiple instances</h1>
<p>here we learn how to apply our jQuery plug in for each element with our plugin instance .<br />
by default JavaScript assumes each variable and object are static, if you change any where it remains stateless.<br />
To understand this code we must aware of </p>
<ul>
<li>JavaScript scope of variables.</li>
<li>jquery basics.</li>
</ul>
<h3><a href='http://www.maheshchari.com/wp-content/uploads/2010/03/jquery-multiple-instance.zip'>Download Demo</a></h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
instanceId<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>	
	$.<span style="color: #660066;">fn</span>.<span style="color: #660066;">my_plugin</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">//default options for our plugin</span>
		defaultOptions<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span>instanceData<span style="color: #339933;">:</span><span style="color: #3366CC;">'mahesh'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">//for every element we create new instance options</span>
		<span style="color: #006600; font-style: italic;">// remember here {} ,means we create empty object and extend with </span>
		<span style="color: #006600; font-style: italic;">//default options</span>
		<span style="color: #006600; font-style: italic;">//user options</span>
		options<span style="color: #339933;">=</span>$.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>defaultOptions<span style="color: #339933;">,</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
		<span style="color: #006600; font-style: italic;">//call the function that create new instance object of our plugin </span>
		$.<span style="color: #660066;">my_pluginInstanceCreater</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
$.<span style="color: #660066;">my_pluginInstanceCreater</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>target<span style="color: #339933;">,</span>options<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">//if given target element  don't have already instance of our plugin</span>
	<span style="color: #006600; font-style: italic;">//then we create a new instance and assign it to target</span>
	<span style="color: #006600; font-style: italic;">//if target elment has already instance of our plugin return it</span>
	<span style="color: #000066; font-weight: bold;">return</span> target.<span style="color: #660066;">my_plugin</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>target.<span style="color: #660066;">my_plugin</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> $.<span style="color: #660066;">my_pluginInstance</span><span style="color: #009900;">&#40;</span>target<span style="color: #339933;">,</span>options<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// this is main core plugin instance where we code every thing </span>
$.<span style="color: #660066;">my_pluginInstance</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>target<span style="color: #339933;">,</span>options<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	$<span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">instanceData</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'  ,Instance Id: '</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span>instanceId<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #006600; font-style: italic;">// function to create our own plugin scope of variables</span></pre></div></div>

<h3><a href='http://www.maheshchari.com/wp-content/uploads/2010/03/jquery-multiple-instance.zip'>Download Demo</a></h3>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=532&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/jquery-multiple-instances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hide browser  context menu -jquery</title>
		<link>http://www.maheshchari.com/hide-browser-context-menu-jquery/</link>
		<comments>http://www.maheshchari.com/hide-browser-context-menu-jquery/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 12:38:39 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=465</guid>
		<description><![CDATA[Hide the web browser context menu with jquery Sometimes we need to prevent the context menu from the browser when user right clicks on the element . for example preventing the user from saving image from application,viewing the source code of the web page. it is very simple to do that using jquery with &#8220;contextmenu&#8221; [...]]]></description>
			<content:encoded><![CDATA[<h1>Hide the web browser context menu with jquery</h1>
<p>Sometimes we need to prevent the context menu from the browser when user right clicks on the element . for example preventing the user from saving image from application,viewing the source code of the web page.<br />
it is very simple to do that using jquery with  &#8220;contextmenu&#8221; event</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'contextmenu'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>
In the above example we disabled context menu on the images by saving. we can see this demo on my previous post about the jquery <a href="http://www.maheshchari.com/jquery-mouse-gestures-real-demo/" target="_blank">mouse gestures</a>.</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=465&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/hide-browser-context-menu-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery mouse gestures real demo</title>
		<link>http://www.maheshchari.com/jquery-mouse-gestures-real-demo/</link>
		<comments>http://www.maheshchari.com/jquery-mouse-gestures-real-demo/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 12:27:26 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=456</guid>
		<description><![CDATA[A Simple jQuery mouse gestures demo and tutorial. You can see this example live over top of my blog header, it shows mouse left,right,middle ,over events live. here we learn how did i implemented this. HTML of demo Here we use simple logic with four layers for each mouse event. code shown below &#60;div id=&#34;mouse-div&#34;&#62; [...]]]></description>
			<content:encoded><![CDATA[<h1>A Simple jQuery mouse gestures demo and tutorial. </h1>
<p><a href="http://www.maheshchari.com/wp-content/uploads/2010/03/mouse.png"><img src="http://www.maheshchari.com/wp-content/uploads/2010/03/mouse.png" alt="" title="mouse" width="200" height="240" class="alignleft size-full wp-image-462" /></a>You can see this example live over top of my blog header, it shows mouse left,right,middle ,over events live. here we learn how did i implemented this.</p>
<h3>HTML of demo</h3>
<p>Here we use simple logic  with four layers for each mouse event. code shown below</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;mouse-div&quot;&gt;
  &lt;div id=&quot;mouse-parts&quot;&gt;
    &lt;div id=&quot;mouse-left&quot;&gt;&amp;nbsp;&lt;/div&gt;
    &lt;div id=&quot;mouse-right&quot;&gt;&amp;nbsp;&lt;/div&gt;
    &lt;div id=&quot;mouse-blink&quot;&gt;&amp;nbsp;&lt;/div&gt;    
    &lt;div id=&quot;mouse-middle&quot;&gt;&amp;nbsp;&lt;/div&gt;
  &lt;/div&gt;</pre></div></div>

<h3>CSS of Demo</h3>
<p>Total mouse main element <b>#mouse-div</b> was positioned absolutely with mouse background.</p>
<p>mouse main element has another element called <b>#mouse-parts</b> and positioned relatively with main element.</p>
<p><b>#mouse-left</b> element positioned with main background and its mouse left click event background matched exactly with absolute positioning.</p>
<p><b>#mouse-right</b> element positioned with main background and its mouse right click event background matched exactly with absolute positioning.</p>
<p><b>#mouse-middle</b> element positioned with main background and its mouse middle  click event background matched exactly with absolute positioning.</p>
<p><b>#mouse-blink</b> element positioned with main background and its mouse over  event background matched exactly with absolute positioning.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#mouse-div</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">240px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">14px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">51px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">mouse.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#mouse-div</span> <span style="color: #cc00cc;">#mouse-parts</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#mouse-parts</span> <span style="color: #cc00cc;">#mouse-</span><span style="color: #993333;">blink</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">43px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">45px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">mouse-over.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">center</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">114px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">165px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#mouse-parts</span> <span style="color: #cc00cc;">#mouse-</span><span style="color: #000000; font-weight: bold;">left</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">141px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">114px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">mouse-left.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">24px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#mouse-parts</span> <span style="color: #cc00cc;">#mouse-</span><span style="color: #000000; font-weight: bold;">right</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">142px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">110px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">mouse-right.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">62px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#mouse-parts</span> <span style="color: #cc00cc;">#mouse-</span><span style="color: #993333;">middle</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">128px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">82px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">mouse-middle.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">33px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-1px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>jQuery Code</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mouse-div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mouse-blink'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mouse-blink'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">mousedown</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//fire the each event when mouse button pressed</span>
e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">which</span><span style="color: #339933;">==</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mouse-left'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//show the mouse-left element over the mouse that was brightened</span>
<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">which</span><span style="color: #339933;">==</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mouse-right'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//show the mouse-right element over the mouse that was brightened</span>
<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">which</span><span style="color: #339933;">==</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mouse-middle'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//show the mouse-middle element over the mouse that was brightened</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">mouseup</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mouse-left,#mouse-right,#mouse-middle'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #006600; font-style: italic;">//reset the all images to hidden state when mouse released</span>
.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'contextmenu'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//hide the default context menu when right clicking on main element.</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3><a href='http://www.maheshchari.com/wp-content/uploads/2010/03/jquery-mouse-guestures.zip'>View Demo and Download &#8216;jquery mouse guestures&#8217;</a></h3>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=456&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/jquery-mouse-gestures-real-demo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery ajaxstart ajaxstop</title>
		<link>http://www.maheshchari.com/jquery-ajaxstart-ajaxstop/</link>
		<comments>http://www.maheshchari.com/jquery-ajaxstart-ajaxstop/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 11:14:48 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=393</guid>
		<description><![CDATA[Displaying Ajax started element using JQuery ajaxstart,ajaxstop jQuery is most famous javascript library compared to its concurrents. One of importent functionality in jQuery is its Ajax handling. It has very flexible methods for Ajax.We seen how to handle the Ajax Errors in my previous Article.Here we concentrate on jQuery ajaxstart,ajaxstop default methods to handle globally. [...]]]></description>
			<content:encoded><![CDATA[<h2>Displaying Ajax started element using JQuery ajaxstart,ajaxstop</h2>
<p>jQuery is most famous javascript library compared to its concurrents. One of importent functionality in jQuery is its Ajax handling. It has very flexible methods for Ajax.We seen how to handle the Ajax Errors in my previous Article.Here we concentrate on jQuery ajaxstart,ajaxstop default methods to handle globally. </p>
<p>Present it is very common to use ajax for every functionality,while querying externel resources with ajax we have to show the end user there is something happening behind the page.Some novice users don&#8217;t know about this functionality. So we must intimate the end user we are working on back end. Some times Ajax calls takes more time to respond with some reason. in that case most users confused about it may be stopped working . so here we take one example and tutorial.</p>
<h3>ajaxStart</h3>
<p>This method is called globally by jQuery while before starting any ajax call starts.</p>
<h3>ajaxstop</h3>
<p>This method called after stopping the Ajax stopped successfully or Ajax call cancelled.</p>
<p>These methods called on $.getJSON,$.get,$.post,$().load,$.getScript function.</p>
<h3>Example</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="javacript" style="font-family:monospace;">jQuery().ready(function(){ //Dom ready 
$('#loadimg').ajaxStart(function(){$(this).show();});//this method for ajax start		
$('#loadimg').ajaxStop(function(){$(this).hide();});//this method for ajax stop
$('#loadjson').click(function(){
$.getJSON('ajax.js',function(d){alert(d.name);});//$.getJSON method
});
$('#loadelement').click(function(){$(this).load('loadsnippet.html')});//load method
});</pre></td></tr></table></div>

<p><a href="http://www.maheshchari.com">Try more examples</a></p>
<p>&nbsp;</p>
<p><a href='http://www.maheshchari.com/wp-content/uploads/2010/01/ajaxstart.zip'>Demo Download</a></p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=393&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/jquery-ajaxstart-ajaxstop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

