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
Post a Comment