Naveen Yogi, Naveen Web Design, Web Designing

html,css,html5,css3,javascript,jquery blog there is queries with solution regarding the web designing

Pages

  • Home
  • HTML & CSS
  • jQuery

Thursday, 6 April 2017

How to use jquery to toggle class for 1 second every 5 seconds

setInterval(function(){ 
   // toggle the class every five second
   $('#maindiv').toggleClass('activeclass');  
   setTimeout(function(){
     // toggle back after 1 second
     $('#maindiv').toggleClass('activeclass');  
   },1000);

},5000);
Posted by naveenwebdesign at 05:50
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

naveenwebdesign
View my complete profile

Blog Archive

  • ►  2023 (1)
    • ►  February (1)
  • ►  2022 (1)
    • ►  April (1)
  • ►  2019 (6)
    • ►  November (1)
    • ►  July (1)
    • ►  June (1)
    • ►  April (1)
    • ►  March (2)
  • ►  2018 (7)
    • ►  April (4)
    • ►  March (2)
    • ►  January (1)
  • ▼  2017 (16)
    • ►  September (1)
    • ►  August (1)
    • ►  July (2)
    • ►  June (2)
    • ►  May (1)
    • ▼  April (5)
      • Hover effect on button (effect#2)
      • Hover effect on image (effect#1)
      • How to use jquery to toggle class for 1 second eve...
      • jQuery scroll to anchor (minus set amount of pixels)
      • How to change three classes one by one continuously
    • ►  March (1)
    • ►  February (3)
  • ►  2016 (13)
    • ►  July (9)
    • ►  June (2)
    • ►  May (2)
Simple theme. Powered by Blogger.