jQuery Question
Posted: Wed Aug 06, 2008 9:10 pm
I've put together a quick page with a link and a <p> below it. Mousing over the link shows the <p>, and once you move your mouse off of the link, the <p> is hidden. (Simple, right?) See http://www.imderek.com/dev/jquery.php.
The question is: how can I make it so that the <p> stays open if you move your mouse down from the link and into the <p>, and then finally hide it if the mouse moves off of it?
Much thanks in advance.
Code: Select all
$(document).ready(function(){
$('p').hide();
$('a#toggleLink').mouseover(function(){
$('p').show('fast');
});
$('a#toggleLink').mouseout(function(){
$('p').hide('fast');
});
});Code: Select all
<a href="#" id="toggleLink">Toggle content</a>
<p>Maecenas facilisis dictum ante. Duis ac nisl...</p>
Much thanks in advance.