Basic image rotation with jQuery -


I would like to test the banner (two CSS background images) and rotate them randomly on each page reload. Is it possible to achieve something without using any plugins?

I just need to rotate two images, which basically just swap the CSS squares on the banner element at each reload .

Many thanks.

Since you have specifically asked to specify a CSS class, there is a jquery function such that To:

  $ (function () {var id = Math.floor (Math.random (* * 10); $ ("# banner") AddClass ("className" + ID);}  

There are some more functions related to this, you can get the document here:


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -