I have been trying to make a div fade in evey 30sec and out after 30sec
setInterval(function(){$('#myDiv').toggle();}, 300);
$("#popupboxdis").fadeIn("fast");
$("#popupboxdis").fadeOut("fast");
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The setInterval time is in milliseconds:
Notice the extra
0s. As it is right now it will try to toggle the element every 300 milliseconds or .3 seconds which is probably resulting in some wacky behavior. Also, the code above should do what you described, I am not sure where the other 2 lines come into play…Also note that without a time string (‘slow’, ‘normal’, ‘fast’) or a time in ms (1000, 2000) as an argument,
togglewill simply hide and show the elements without the fading animation you are looking for.