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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -