the toggle function toggle the display not any action. You need write code to toggle the action. $("li").dblclick(function() { if($(this).didSomeThing == true){ $(this).backToNormal(); $(this).didSomeThing = false; return; } $(this).doSomething(); $(this).didSomeThing = true; });
On Sat, Oct 4, 2008 at 9:29 AM, sere <[EMAIL PROTECTED]> wrote: > > If an <li> is single clicked, nothing should happen. If it is double > clicked, it will perform a certain action on the element. If it is > double clicked again, the <li> will revert back to normal. > > On Oct 3, 9:59 pm, Dave Methvin <[EMAIL PROTECTED]> wrote: > > Can you describe what you want to happen? For example, "When an li > > element is double-clicked, it should _____. If it is single-clicked > > the first time it should ___ and the second time it should _____. If > > it is single-clicked but then double-clicked it should ____." > > > > Also, remember that a click event is always delivered before a double- > > click. (It doesn't know you meant to double click until it's already > > delivered the click.) >