jQuery .toggle() not working as expected with second function? -
I'm trying to create a button below to show / hide a div, all is fine, I just fine I'm struggling with the last bit!
I should segregate the weather, this is a show or hide action, so I can pass the variable elsewhere, here I have what is ..
< Code> $ (() () () () () () () () () () () (.) .attr ("id") + 'show');}, function () {warning ($ ( This) .Parent (). Attr ("id") + 'hide');});}). )});
If you use the following code, do the other function within the toggle (), then it works?! But then I have no show / hidden variables.
$ (this) .find ('.-Hide-close'). Click (function () {$ (this) .siblings ('.dragbox-content') toggle (function () {warning ($ (this) .Parent (). Attr ("id") + 'Show') ;})}}) .end ()});
Thanks in advance for any help, hopefully this is really something simple, I just can not see! :
You can use $ (this) .is (": visible") Under the
function, to see if its visible or not.
Comments
Post a Comment