Shuffle banners

Posted on 2004-08-04
Last Modified: 2012-05-05
How can i shuffles client banners on my site?
Question by:golfDoctor
  • 2
LVL 31

Accepted Solution

alorentz earned 500 total points
ID: 11714849
Name all you pictures with numbers:


Then randomize to get number:

Randomize   ' Initialize random-number generator.
pic = Int((6 * Rnd) + 1)  'random number 1-6
<img src="<%=pic%>.jpg">
LVL 22

Expert Comment

ID: 11714909

You can do it at client end only without refreshing ur page..

<SCRIPT Language="Javascript">
counter = 0
imgArr = new Array("img0.gif","img1.gif","img2.gif","img3.gif","img4.gif")

function changeImage()
     if (counter > imgArr.length)
          counter = 0

<p><img border="0" src="img1.gif" id="banner"></p>

check this for more details

LVL 16

Author Comment

ID: 11714927
neerja- No, I meant shuffle, one per page.  Thanks.
LVL 16

Author Comment

ID: 11714933
Thanks, that works well.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Leverage browser caching 2 55
Adding items to html ul from on server side. 4 55
currencylayer API intergrate to ASP 25 66
Auto Submit on dropdown box 3 56
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now