944,117 Members | Top Members by Rank

Ad:
Mar 20th, 2006
0

Html Rotators

Expand Post »
Hey all,

I was wondering does anyone know of any html rotator scripts that can be time coded to show a particular picture at a specified time of day? I have an internet radio station and I would like to show my personalities on the home page to my website as they are broadcasting, and once their show is over the picture of the next personality would pop up.

I've tried to use PHP and I was like 30 seconds from putting an axe to my pc. I use Yahoo site builder to build my site and there is a section in my control panel that will take me to a PHP folder but I can't get it to work. Html is so much easier.

Please help!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dallas9712 is offline Offline
2 posts
since Mar 2006
Mar 20th, 2006
0

Re: Html Rotators

Something nuts like this?
HTML and CSS Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function startTime()
  5. {
  6. /* Paths To The Pictures To Load */
  7. var picpath1 = "http://www.someurl.com/pics/djlady.jpg";
  8. var picpath2 = "http://www.someurl.com/pics/djdude.jpg";
  9. var picpath3 = "http://www.someurl.com/pics/djnewguy.jpg";
  10.  
  11.  
  12. /* Times of Triggers */
  13. var hour1 = 5;
  14. var hour2 = 8;
  15. var hour2 = 11;
  16. var min1 = 0;
  17. var min2 = 0;
  18. var min3 = 0;
  19. var sec1 = 0;
  20. var sec2 = 0;
  21. var sec3 = 0;
  22.  
  23. var today=new Date();
  24. var h=today.getHours();
  25. var m=today.getMinutes();
  26. var s=today.getSeconds();
  27.  
  28. if (h == hour1) && (m == min1) && (s == sec3) {
  29. document.write('<IMG SRC="' + picpath1 + '>');
  30. } else if (h == hour2) && (m == min2) && (s == sec3) {
  31. document.write('<IMG SRC="' + picpath2 + '>');
  32. } else if (h == hour3) && (m == min3) && (s == sec3) {
  33. document.write('<IMG SRC="' + picpath3 + '>');
  34. }
  35. }
  36. </script>
  37. </head>
  38.  
  39. <BODY>
  40. <SCRIPT LANGUAGE="Javascript">
  41. startTime();
  42. </SCRIPT>
  43. </body>
  44. </html>
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Mar 21st, 2006
0

Re: Html Rotators

That would be great however, I'm not sure just how to add it to the script I am already using. Here's the code I'm using. I can change the interval of the pictures that are rotating by seconds. I would like them to rotate like (picture 1 - 10:00 am - 2:pm) (picture 2 - 2:00 pm - 6:00pm) and so on. I tried to implement the script you sent but I couldn't get it to work.

Also: Should I be concerned that I am in central standard time will the script work for all time zones?


<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: VIP Records (1073vip@radio.fm) -->
<!-- Web Site: http://www.viprecordsinc.com-->

<!-- 107.3 VIP ON-LINE RADIO GIVING YOU MORE BANG FOR YOUR BANDWIDTH -->
<!-- http://www.viprecordsinc.com -->

<!-- Begin
var interval = 2.5; // delay between rotating images (in seconds)
var random_display = 0; // 0 = no, 1 = yes
interval *= 2000;

var image_index = 0;
image_list = new Array();
image_list[image_index++] = new imageItem("http://viprecordsinc.com/images/a759.jpg");
image_list[image_index++] = new imageItem("http://viprecordsinc.com/images/Kbrown.bmp");
image_list[image_index++] = new imageItem("http://viprecordsinc.com/images/kim2.JPG");
image_list[image_index++] = new imageItem("http://viprecordsinc.com/images/Allen.jpg");
image_list[image_index++] = new imageItem("http://viprecordsinc.com/images/RL1.jpg");
var number_of_image = image_list.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}
function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
}
// End -->
</script>
</HEAD>

<BODY OnLoad="rotateImage('rImage')">

<center>
<img name="rImage" src="http://viprecordsinc.com/img/image-cycler/01.jpg" width=165 height=165>
</center>
<p><center>

<!-- Script Size: 2.29 KB -->
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dallas9712 is offline Offline
2 posts
since Mar 2006
Oct 29th, 2007
0

Re: Html Rotators

I too need help with this exact issue. I do not know how to use this code.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
LittleStar is offline Offline
1 posts
since Oct 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Complicated CSS, Noob Needs Help!!! =)
Next Thread in HTML and CSS Forum Timeline: Overlapping Flash Nav Bar Disabling links.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC