kernel-stack
11-30-2010, 07:08 AM
Hello everyone,
I got this small script using jQuery that slides down a <ul> when an image is clicked. I was wondering how I could make the ul slide back when the mouse moves away from it and not demand from the user to click on the image again. I tried changing click() to mouseover() but that of course doesn't take into account the ul.
<script type="text/javascript">
$(document).ready(function () {
$('img.menu_class').click(function() {
$('ul.the_menu').slideToggle('medium');
});
});
Thanks in advance!
I got this small script using jQuery that slides down a <ul> when an image is clicked. I was wondering how I could make the ul slide back when the mouse moves away from it and not demand from the user to click on the image again. I tried changing click() to mouseover() but that of course doesn't take into account the ul.
<script type="text/javascript">
$(document).ready(function () {
$('img.menu_class').click(function() {
$('ul.the_menu').slideToggle('medium');
});
});
Thanks in advance!