473,659 Members | 2,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Banner, a link for each image?

8 New Member
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="runSlid eShow()" >
<SCRIPT LANGUAGE="JavaS cript">


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.c om";
url[3] = "http://www.257oops.com ";
url[4] = "http://www.257group.co m";



var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
var crossFadeDurati on = 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.styl e.filter="blend Trans(duration= 2)";
document.images .SlideShow.styl e.filter="blend Trans(duration= crossFadeDurati on)";
document.images .SlideShow.filt ers.blendTrans. Apply();
}
document.images .SlideShow.src = preLoad[j].src;
if (document.all) {
document.images .SlideShow.filt ers.blendTrans. Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('run SlideShow()', slideShowSpeed) ;
}


function banner() {
timer=setTimeou t("banner()", 4000);
counter++;
if (counter >= 3)
counter = 0;
document.banner ad.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="javascrip t:gothere()"><i mg src="1.jpg" name='SlideShow '></a>

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

</body>
</html>
[/HTML]
cheers
Nov 27 '07 #1
3 1980
acoder
16,027 Recognized Expert Moderator MVP
In the gothere() function, replace "counter" with "j" (the index pointer to the images).
Nov 27 '07 #2
kennykenn
8 New Member
In the gothere() function, replace "counter" with "j" (the index pointer to the images).
Brilliant thankyou!!!!
Nov 29 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
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
2081
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 on our site.....? > > Some of the vendors we deal with may not have sophisticated tracking devices > to allow us to determine if we are contributing to their sales....
1
2102
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 images, even worse they are not loading completely. This version includes a (vain) attempt at forcing the banner images to cache. Apart form the caching problem the scripting seems to work Any help welcomed:
4
1961
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). I use an ASP Web Stats program called Power-Stats to track my website traffic, search keywords... The data is stored in an Access Database hosted on my website. I'd like to be able to track how many clicks I get on each of my banner ads,...
3
2353
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/ ? thank you very much.
2
2818
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, rotates banners with hyperlink specific to each image. it works just perfect but i need a simple modification. now I want to stop rotating the images when I mouseover on the image, and then continue once I move the cursor out of the banner image....
1
2484
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 path to the images, like "../img" or "random/images/". // If the images are in the same directory, leave it blank. $folder = ''; // Space seperated list of extensions, you probably won't have to change this.
10
5440
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 autoadjust. Knbowing that this middle image can be horizontally distorded without problem about aspect. Here is my test page with a dummy banner : http://yohannl.tripod.com/autoadjust_banner/banner.html
24
3611
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 show what I'm talking about. http://screencast.com/t/i5SLg3cAczH (*WARNING, TAKES A WHILE TO LOAD*) *HTML* <html> <head> <title>James Mann - Portfolio</title>
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8535
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2757
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.