473,385 Members | 1,727 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,385 software developers and data experts.

alt view for images in an array

How would you create a different alt view for each image in the following?

<script language="JavaScript">
var i = 1;
banner1= new Image();
banner1.src = "image1jpg";
banner2= new Image();
banner2.src = "image2.jpg";

var links = new Array

links[1] = "http://www.centerforplantconservation.org/testing/image1.jpg"
links[2] = "http://www.centerforplantconservation.org/testing/image2.jpg"

function loadBanner(){

var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
closeTime=hours*3600+mins*60+secs;

// Change this number to increase decrease the rotation speed
closeTime+=3;

Timer();

}

function Timer(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
curTime=hours*3600+mins*60+secs
if (curTime>=closeTime){
if (i < 5){
i++;
document.banner.src = eval("banner" + i +
".src");
}
else{
i = 1;
document.banner.src = eval("banner" + i +
".src");
} loadBanner();
}
else{
window.setTimeout("Timer()",1000)}

}

function clickLink(){
top.location = links[i]
}

function changeAlt(){
var image = ??????
??????
}

</script>
Jul 20 '05 #1
1 1457
On 7 Aug 2003 13:52:38 -0700, lu****@globalccs.net (Rick) wrote:
document.banner.src = eval("banner" + i +
".src");


don't use eval, don't just use document.

so:

document.images['banner'].src=window['banner'+i].src
document.images['banner'].alt=window['banner'+i].alt

for alt and src.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical)...
12
by: Raed Sawalha | last post by:
I have the following table which i can not switcha to design view error message said Could not open in Design view. Quote values differently inside a '<% ...."value"... %>' block. and the...
3
by: Arun | last post by:
Hi, I have simple question to ask. How to write multiple Binary files to the Browser using Asp.Net and Visual C#.net I have seen examples where single binary file is written to browser. ...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
2
by: mikeoley | last post by:
Ok I have a Javascript slideshow working. Every image is linked to a another page in the site. Problem is...The link wont refresh to the next link once the second images rollovers in the slideshow....
2
by: utahwrx | last post by:
I currently have a Javascript application that randomizes about 200 images. The problem is that the images preload, which causes the entire site to not come up until all the images are loaded. I'd...
3
tpgames
by: tpgames | last post by:
2x2 Sudoku doesn't work at all. The images don't show up on the grid. I don't understand JavaScript very well. Just learning it. Thanks! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
4
toxicpaint
by: toxicpaint | last post by:
Hi, can anyone give me a hand. I'm currently displaying 4 random images at the top of a page. I did this using an array of 35 pictures and then writing them to page. The problem I have is that in...
9
by: Confused but working on it | last post by:
Just wanted to say thanks for the posts helping me make ths work. Added a few comments and after the readdir used a pattern match to test for ..jpg, and seems to work fine on my test setup. Maybe I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.