Jquery toggle incorrectly removing element from page -
can tell why works correctly add , remove "hover" class existing buttons on page:
$(".button").click(function () { $(this).toggleclass("hover"); });
but when try instead, buttons inline "display:none" tag attached them , disappear off page?
$(".button").toggle(function () { $(this).addclass("hover"); }, function () { $(this).removeclass("hover"); });
i'm on win7 using jquery 1.11.1 , able re-create issue in ff, chrome ie.
this strictly learning excercise, appreciated.
i think misunderstood .toggle method. http://api.jquery.com/toggle/ according documentation, it's used hide or display element.
Comments
Post a Comment