|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Rotating Banner
If anyone could help me with a little problem I have? I have rotating banners on my website but it only changes when it is refreshed. Is there any possability to have it refresh every 10 seconds or so? my web page is www.maxitout.tv . I really apreciate it.
Thanks in advance Jose |
|
#2
|
|||
|
|||
|
RE: Rotating Banner
You need to use javascript instead of PHP
Doj |
|
#3
|
|||
|
|||
|
RE: Rotating Banner
thanks for the response but where can I find that?
|
|
#4
|
|||
|
|||
|
RE: Rotating Banner
http://www.javascriptsource.com is a pretty useful site. This is probably what you want:
http://javascript.internet.com/miscellaneous/random-image-rotator.html#source Doj |
|
#5
|
|||
|
|||
|
RE: Rotating Banner
it worked just great! Thanks.
I also need to put links on each image. is there a way to do this. |
|
#6
|
|||
|
|||
|
RE: Rotating Banner
this should really be in the client-side forum, but here's the code.
Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Robert Bui (astrogate@hotmail.com) -->
<!-- Web Site: http://astrogate.virtualave.net -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var interval = 2.5; // delay between rotating images (in seconds)
var random_display = 1; // 0 = no, 1 = yes
interval *= 1000;
var image_index = 0;
var link_index = 0;
image_list = new Array();
link_list = new Array();
image_list[image_index++] = new imageItem("http://javascript.internet.com/img/image-cycler/01.jpg");
image_list[image_index++] = new imageItem("http://javascript.internet.com/img/image-cycler/02.jpg");
image_list[image_index++] = new imageItem("http://javascript.internet.com/img/image-cycler/03.jpg");
image_list[image_index++] = new imageItem("http://javascript.internet.com/img/image-cycler/04.jpg");
link_list[link_index++] = "http://www.something.com";
link_list[link_index++] = "http://www.somethingelse.com";
link_list[link_index++] = "http://www.anotherthing.com";
link_list[link_index++] = "http://www.ohlook, number 4.com";
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,anchor) {
var new_image = getNextImage();
document[place].src = new_image;
document.getElementById("rLink").href = link_list[image_index];
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY OnLoad="rotateImage('rImage','rLink')">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<center>
<a id="rLink" href="">
<img name="rImage" src="http://javascript.internet.com/img/image-cycler/01.jpg" width=120 height=90>
</a>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 2.29 KB -->
|
|
#7
|
|||
|
|||
|
RE: Rotating Banner
Thanks so much. This is my personal hobby website. We don't even charge for the banners, they are just friends of mine. This is a weekend project company.
You guys have been such a great help!!!! I just have one last question... How can I have the link open in a new window? Thanks Again Jose |
|
#8
|
|||
|
|||
|
Message Moved
Thread moved from 'PHP Coding' to 'Client Side Things' by tkarkkainen.
Reason: |
|
#9
|
|||
|
|||
|
RE: Rotating Banner
<a id="rLink" target="_new" href="">
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Rotating Banner |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|