Welcome to %s forums

<No. 1 Community for developers, by developers/>

Login Register

How to cycle through any anchor link using jQuery?

Get support on JavaScript,jQuery, AJAX and other related technology.
Post Reply
admin
Site Admin
Posts: 45

How to cycle through any anchor link using jQuery?

Post by admin » Thu Aug 22, 2019 10:58 pm

HTML

Code: Select all

<div id="links"> <a class="links" href="http://www.google.com">Google</a>
  <a class="links" href="http://www.facebook.com">Facebook</a>
  <a class="links" href="http://www.Twitter.com">Twitter</a>
</div>
jQuery:

Code: Select all

$(document).ready(function() {
  $('#links').cycle();
})
The default transition time is 4 seconds, but you can override this by setting the timeout option. Like so:

Code: Select all

$(document).ready(function() { 
  $('#Links').cycle({ 
       timeout : 3000 
  }); 
}) 
Demo

Post Reply