Html Rotators

Reply

Join Date: Mar 2006
Posts: 2
Reputation: dallas9712 is an unknown quantity at this point 
Solved Threads: 0
dallas9712 dallas9712 is offline Offline
Newbie Poster

Html Rotators

 
0
  #1
Mar 20th, 2006
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!
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Html Rotators

 
0
  #2
Mar 20th, 2006
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>
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 2
Reputation: dallas9712 is an unknown quantity at this point 
Solved Threads: 0
dallas9712 dallas9712 is offline Offline
Newbie Poster

Re: Html Rotators

 
0
  #3
Mar 21st, 2006
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 -->
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1
Reputation: LittleStar is an unknown quantity at this point 
Solved Threads: 0
LittleStar LittleStar is offline Offline
Newbie Poster

Re: Html Rotators

 
0
  #4
Oct 29th, 2007
I too need help with this exact issue. I do not know how to use this code.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC