Site Logo

Office of Web Services Forum

Use this forum for Cascade Support, HTML/CSS tips and tricks, as well as discussions between webmasters from all across the university.
 
It is currently Mon Nov 23, 2009 5:51 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Rotate Image on Refresh
PostPosted: Mon Feb 02, 2009 9:04 am 
Offline
Site Admin

Joined: Fri Aug 15, 2008 7:37 am
Posts: 16
1. Copy this code into the website where you would like the images to rotate. You can also save this code in a separate file (ex. rotateImageOnRefresh.js) and include it where you would like to use it:

Code:
<script src="pathToFile/rotateImageOnRefresh.js"></script>


########### IMAGE ROTATE CODE BELOW ############
Code:
var featureNo
var myFeature = new Array()

<!-- CHANGE img src= to the file path of your image --!>

myFeature[] = '<img src="images/features/01.jpg" width="356" height="220" alt="Put Your ALT TAG here" border="0">'

myFeature[] = '<img src="images/features/02.jpg" width="356" height="220" alt="Put Your ALT TAG here" border="0">'

myFeature[] = '<img src="images/features/03.jpg" width="356" height="220" alt="Put Your ALT TAG here" border="0">'

myFeature[] = '<img src="images/features/04.jpg" width="356" height="220" alt="Put Your ALT TAG here" border="0">'

myFeature[] = '<img src="images/features/05.jpg" width="356" height="220" alt="Put Your ALT TAG here" border="0">'


<!-- DONT TOUCH BELOW -->
featureNo = Math.round(Math.random() * (myFeature.length -1))
document.write(myFeature[featureNo])


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group