Dyr
Junior Poster
Posts: 36
|
Post by Dyr on Jul 25, 2011 16:59:10 GMT
Hi again! Have another question for ya. I figured out how to reload one image every x seconds, but I have 5 different images I'd like to reload and change their image. simtrade.proboards.comThere's my test site. I got one image working every 5 seconds (will later change to an hour), was wondering if I could do the same with the other 4 images using the same code?
|
|
Nick
VIP
v5 Beta Tester[M:5000]
Philadelphia Eagles: 8-8
Posts: 2,239
|
Post by Nick on Jul 25, 2011 17:07:13 GMT
So essentially you want a slide show type thing?
|
|
Dyr
Junior Poster
Posts: 36
|
Post by Dyr on Jul 25, 2011 17:43:43 GMT
Well basically the image changes once every hour, when the page loads. Right now I have it set-up as a slideshow that changes every 5 seconds just to test it, I'd have to modify it sorry. x3 But it's a simple modification to do I'm not worried about that, I'm just a little in the dark with adding 4 other images in to the mix. :3
|
|
Nick
VIP
v5 Beta Tester[M:5000]
Philadelphia Eagles: 8-8
Posts: 2,239
|
Post by Nick on Jul 25, 2011 17:49:49 GMT
If you want it to change hourly, I don't think having a timer would work, or the user would have to stay on the same page for an hour for it to work I believe since JS is client side. However, try doing something to the sense of : var hour = getHours(); if (hour == 6) { document.write("<img src=\"IMGURL\" />"); } if (hour == 7) { document.write("<img src=\"IMGURL\" />"); } And so on I hope this makes sense
|
|
Dyr
Junior Poster
Posts: 36
|
Post by Dyr on Jul 25, 2011 19:39:53 GMT
ah yes it does. Thank you very much! ^^ For multiple images, would I just put in multiple image src's for each hour?
such as: if (hour == 6) { document.write("<img src=\"IMGURL\" /> <img src=\"IMGURL\" />"); }
|
|
Nick
VIP
v5 Beta Tester[M:5000]
Philadelphia Eagles: 8-8
Posts: 2,239
|
Post by Nick on Jul 25, 2011 19:49:18 GMT
Yes, that'd work
|
|
|
Post by (/iPokemon/) on Jul 25, 2011 20:55:42 GMT
If you want it to refresh by itself, use javascript's setInterval too
|
|
Dyr
Junior Poster
Posts: 36
|
Post by Dyr on Jul 25, 2011 21:45:43 GMT
Would each image I put in said row be different from one another? I'd like them not to be uniform. Sorry for being so vague in my original post. ^^;
|
|
Nick
VIP
v5 Beta Tester[M:5000]
Philadelphia Eagles: 8-8
Posts: 2,239
|
Post by Nick on Jul 25, 2011 22:12:02 GMT
It depends how you code it. Do you want all 5 images to change at the same time?
|
|
Dyr
Junior Poster
Posts: 36
|
Post by Dyr on Jul 26, 2011 11:41:49 GMT
Yes, that would be preferred if possible. All change at the same time, each image different. Thank you, this coding is all very new to me and I appreciate your help. ^^
|
|
Nick
VIP
v5 Beta Tester[M:5000]
Philadelphia Eagles: 8-8
Posts: 2,239
|
Post by Nick on Jul 26, 2011 19:22:29 GMT
Yeah, I don't mind at all! Post if you need anything else!
|
|
|
Post by Oompa Loompa doompadee doo on Jul 27, 2011 2:15:27 GMT
ive been looking for something like this too
|
|
|
Post by (/iPokemon/) on Jul 27, 2011 20:24:09 GMT
So you want a script to change the image source every few seconds? That would hurt the eyes
|
|
Cam!
VIP
[M:5000]
Posts: 780
|
Post by Cam! on Jul 27, 2011 21:55:50 GMT
I would have thought this would be against the ProBoards Terms of Service. Apparently not? Wouldn't this be considered as an automatic refresher type of thing?
|
|
edenwax
VIP
v5 Beta Tester[M:5000]
Posts: 1,266
|
Post by edenwax on Jul 27, 2011 22:24:42 GMT
Yeah I cant find anything on the proboards TOS that says anything about this.
|
|
Cam
Administrator
[M:5000]
Posts: 6,381
|
Post by Cam on Jul 27, 2011 23:02:29 GMT
I would have thought this would be against the ProBoards Terms of Service. Apparently not? Wouldn't this be considered as an automatic refresher type of thing? I think that's the whole page.
|
|
Cam!
VIP
[M:5000]
Posts: 780
|
Post by Cam! on Jul 27, 2011 23:07:26 GMT
But wouldn't a code like this still be a pain on the server the forum is on?
I am almost positive Patrick Clinger has said something like this is against the TOS before. I know whole page automatic refreshing is against the TOS because people need to have a chance to click the advertisements, but I am not sure about this...
|
|