By first Click; hide an element immediately and by second click show it again after 3 seconds
Hi,
I want to achieve that when I click on a button the caption of my slider hides immediately and a second click on the button shows the slider caption after 3 seconds delay.
I tries this code: <style>.hide: display:none;</style>
- ("#hamburger-menu").click(function() {
-
- $(".slider .caption").each(function() {
- var kir = $(this);
- if( kir.hasClass("hide") ) {
- setTimeout( "kir.removeClass('hide');",3000 );
- }
- else {
- kir.addClass("hide");
- }
-
- });
-
But it doesn't work.
Could you please help me what is wrong with my code?
Thanks