[jQuery] Re: One button to do two opposite tasks.

2008-06-27 Thread Glen Lipka
Try using Toggle, rather than Click. That should work. Glen On Fri, Jun 27, 2008 at 3:28 PM, Cristian [EMAIL PROTECTED] wrote: HI, I'm using the code below to create a hover effect. When the user puts the mouse over a div box1 a list of items appear, and when it goes out, the list

[jQuery] Re: One button to do two opposite tasks.

2008-06-27 Thread Sam Sherlock
try this hover $(document).ready(function() { $(#box1).bind('mouseover', function() { $(.ul-list).css({display: 'block'}); }); $(#box1).bind('mouseout', function() { $(.ul-list).css({display: 'none'}); }); }); click toggle

[jQuery] Re: One button to do two opposite tasks.

2008-06-27 Thread Glen Lipka
Also you can do this: $(document).ready(function() { $(#box1).toggle(function() { $(.ul-list).show(); },function() { $(.ul-list).hide() }); }); hide/show do what you need. Glen On Fri, Jun 27, 2008 at 4:51 PM, Glen Lipka [EMAIL PROTECTED]

[jQuery] Re: One button to do two opposite tasks.

2008-06-27 Thread Cristian
I changed Click for Toggle and it worked! Thank you very much, guys.