/    Sign up×
Community /Pin to ProfileBookmark

Help! Image Change (rotate) on Refresh in Sequence Order

I want the images to change (rotate) in sequence when the page is refreshed not random like i have below. Can someone help me with this please? Also I also need text to change on refresh to because I am going to have a descritption of the image below. So the image and text sync up together when some refreshes the page or goes page to the home page. Thanks

I want the images to change like on this page [URL=”http://www.dougv.com/demo/js_ordered_images_onload/”]http://www.dougv.com/demo/js_ordered_images_onload/[/URL]

[CODE]
<script type=”text/javascript” language=”JavaScript”>

var imgs = new Array(‘<a href=”VW_1.shtml”><img border=0 src=”img/samples/VW/large_1.jpg” width=165 height=109″ class=”thumbnail_img”>’,
‘<a href=”fortshelby1.shtml”><img border=0 src=”img/samples/Fort Shelby/image1-large.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”jaguar1.shtml”><img border=0 src=”img/samples/Jag_of_Novi/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”harley1.shtml”><img border=0 src=”img/samples/wolverine_harley/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”bc1.shtml”><img border=0 src=”img/samples/BC_Coney_Island/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”mama1.shtml”><img border=0 src=”img/samples/Pozios_Retail_Mama_Vickys_Coney_Island/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”children1.shtml”><img border=0 src=”img/samples/Detroit_Childrens_Museum/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”harper1.shtml”><img border=0 src=”img/samples/Harper_Woods_Library/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”dps1.shtml”><img border=0 src=”img/samples/DPS_Facilities_building/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”lakeland1.shtml”><img border=0 src=”img/samples/Lakeland_School_Huron_Valley/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”auto1.shtml”><img border=0 src=”img/samples/Manhattan_Auto_Group/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”maxey1.shtml”><img border=0 src=”img/samples/Maxey_Ford/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”benz1.shtml”><img border=0 src=”img/samples/Mercedes_Benz_of_St_Clair_Shores/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”metro_lofts1.shtml”><img border=0 src=”img/samples/Metro_Lofts/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”mtclemens1.shtml”><img border=0 src=”img/samples/Mt_Clemens_Library/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”st_gertrudes.shtml”><img border=0 src=”img/samples/st_gertrudes/large_1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”rayconnect1.shtml”><img border=0 src=”img/samples/Rayconnect/large 1.jpg” width=165 height=109 class=”thumbnail_img”>’,
‘<a href=”faulhauber1.shtml”><img border=0 src=”img/samples/Faulhauber/large1.jpg” width=165 height=109 class=”thumbnail_img”>’);

var max = imgs.length;
var num = Math.floor((Math.random() * max));

document.writeln(imgs[num]);

</script>
[/CODE]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @twistidphreak spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...