473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Banner, a link for each image?

im producing a banner and want the banner to rotate and fade in and out to the next image. i want to link each image to a SEPERATE site! I can get it to work with out the fading effect and can get them all to link to one site with fading! both images and links are in seperate arrays! please help someone!
code below:

[HTML]<html>
<body onLoad="runSlideShow()" >
<SCRIPT LANGUAGE="JavaScript">


var slideShowSpeed = 10000;



var Pic = new Array(5);


Pic[0] = "1.jpg";
Pic[1] = "2.jpg";
Pic[2] = "3.jpg";
Pic[3] = "4.jpg";
Pic[4] = "5.jpg";

var url = new Array(5);

url[0] = "http://www.google.com";
url[1] = "http://www.yahoo.com";
url[2] = "http://www.lovecargo.com";
url[3] = "http://www.257oops.com";
url[4] = "http://www.257group.com";



var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
var crossFadeDuration = 8;
var counter = 0;
var timer = null;
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans (duration=2)";
document.images.SlideShow.style.filter="blendTrans (duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply ();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play( );
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}


function banner() {
timer=setTimeout("banner()", 4000);
counter++;
if (counter >= 3)
counter = 0;
document.bannerad.src = Pic[counter];
}

function gothere() {
counter2 = counter;
window.location.href = url[counter2];
}

}

</script>

<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="VU" height=150 width=150 >
<a href="javascript:gothere()"><img src="1.jpg" name='SlideShow'></a>

</td>
</tr>
</table>
</center>

</body>
</html>
[/HTML]
cheers
Nov 27 '07 #1
3 1948
acoder
16,027 Expert Mod 8TB
In the gothere() function, replace "counter" with "j" (the index pointer to the images).
Nov 27 '07 #2
In the gothere() function, replace "counter" with "j" (the index pointer to the images).
Brilliant thankyou!!!!
Nov 29 '07 #3
acoder
16,027 Expert Mod 8TB
You're welcome. Glad you got it working.
Nov 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: | last post by:
(subject included - apologies) <jason@catamaranco.com> wrote in message news:... > Is there a simple way to track users leaving our site to vendors whose wares > we have advertised as a banner...
1
by: Grunt | last post by:
Hi, I have been trying to put together a rotating banner. the code works but I am having a problem with the caching of the banner images. no matter what I try the page is constantly reloading the...
4
by: Patrick Rouse | last post by:
Please point me to the correct newsgroup if this is the wrong place to post this question. My website is written in simple HTML and hosted on a windows server at secureserver.net (via GoDaddy). ...
3
by: Dan V. | last post by:
Hi there, How can I keep the banner image from wrapping when resizing the width of the window smaller? Firefox seems to do this but not I.E. Any ideas for: http://www.officeactivate.com/ ?...
2
by: sgMuser | last post by:
Hi, I am not a good developer of Javascript codes. Needs this help to make some modification to this famous free javascript from Anarchos. i am using this in one of my webpage. What it does is,...
1
by: Sunshine192 | last post by:
Hi, I'm still kinda new to PHP so I could do with some advice. I'm using the code below to select and show a random image from a folder of images. rotate.php <?php // Make this the relative...
10
by: Yohann L. | last post by:
Hello. I would like to have an horizontal banner which autoadjust its width to 100% of the page width. So, I've sliced the image banner in three parts, but don't find a way to do the middle one...
24
by: GloStix | last post by:
I'm trying to center this banner, it's in a div that has the same width so it's not exactly "centering" but it's screwed up, It works in safari but in Firefox it's messed up. I uploaded a Video to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.