Search code examples
jquerystoppropagation

Stopping a jQuery event function from


I posted a question yesterday which was answered, sadly though I now have a new issue with the said code and am looking for some kind soul to point me in the right direction so I can learn how to get the issues fixed so I dont need to ask for help in the issue again.

Here is the jsfiddle link to the script http://jsfiddle.net/EzYeH/10/

What I am trying to achieve is to stop the event function expand initialising if the event function shrink is still running.

I have tried using and reading up on .stopPropagation() & .stop() but cannot get the implementation correct.

Thanks in advance anyone who can tackle this,

Dan.


Solution

  • See http://jsfiddle.net/EzYeH/13/ for updated code:

    A couple of issues: your $this variable was implicitly global, which was causing layout problems.

    You were not determining the current state to let you figure out whether an expand or shrink was appropriate.