javascript - Div fading in and out -


i need help, working on website want div delay 2 seconds fade in when div clicked, when want click again (to close it) want fade out instantly. help?

if can use jquery, following code got want: default css:

.inviselem{display:none} 

and jquery code:

$('body').on('click', '.boxbutton1', function(){         var counter = $(this).data('count');         if(counter == undefined){             counter = 0;             settimeout(function() {                 $('.gymtext').fadein(500)//fadein after 2 seconds(2000 ms)             }, 2000);         }         else if(counter == 0){             $('.gymtext').fadeout(function(){                 $('.gymtext').remove()             });//fadeout remove         }     }) 

i tried write down novice friendly if needed add comment


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -