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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -