<pclass="desc"><strong>Description: </strong>Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.</p>
<pclass="arguement"><strong>handlerIn(eventObject)</strong>A function to execute when the mouse pointer enters the element.</p>
<pclass="arguement"><strong>handlerOut(eventObject)</strong>A function to execute when the mouse pointer leaves the element.</p>
</li></ul>
<divclass="longdesc">
<p>The <code>.hover()</code> method binds handlers for both <code>mouseenter</code> and <code>mouseleave</code> events. We can use it to simply apply behavior to an element during the time the mouse is within the element.</p>
<p>Calling <code>$(selector).hover(handlerIn, handlerOut)</code> is shorthand for:</p>
<p>See the discussions for <code><ahref="/mouseenter">.mouseenter()</a></code> and <code><ahref="/mouseleave">.mouseleave()</a></code> for more details.</p>
</div>
<h3>Examples:</h3>
<divid="entry-examples"class="entry-examples">
<divid="example-0">
<h4>Example: <spanclass="desc">To add a special style to list items that are being hovered over, try:</span>
<pclass="desc"><strong>Description: </strong>Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.</p>
<pclass="arguement"><strong>handlerInOut(eventObject)</strong>A function to execute when the mouse pointer enters or leaves the element.</p>
</li></ul>
<divclass="longdesc">
<p>The <code>.hover()</code> method, when passed a single function, will execute that handler for both <code>mouseenter</code> and <code>mouseleave</code> events. This allows the user to use jQuery's various toggle methods within the handler.</p>
<p>Calling <code>$(selector).hover(handlerInOut)</code> is shorthand for:</p>
<p>See the discussions for <code><ahref="/mouseenter">.mouseenter()</a></code> and <code><ahref="/mouseleave">.mouseleave()</a></code> for more details.</p>