/    Sign up×
Community /Pin to ProfileBookmark

image references

Do images have to refeneced directly or can they be referenced indirectly.

Trying to set up a thumbnail viewer. I want to build an array with all the images in them and then reference that array when displaying the images.

ie can an image be called like this?

var var1=images[0]

<img name=i1 src=var1.jpg>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63Mar 12.2003 — yes,it can be

:-)

Cheers

Khalid
Copy linkTweet thisAlerts:
@russ801authorMar 12.2003 — here is a snippet that I think should work if that is true.

<SCRIPT language="JavaScript1.2">


var photos = new Array(

new Array("Images/MarH0022V.jpg", "Images/MarH0022T.jpg","Images/MarH0022C.jpg"),

new Array("Images/NicM0421V","Images/NicM0421T",null),

new Array("Message-3W.jpg", null,null),

new Array("Message-1W.jpg","Message-3W.jpg",null)

);


//var bigimg= new Image()

var bigimg=photos[1][0]

alert (bigimg)

</SCRIPT></HEAD>

<BODY bgcolor="#474747">

<TABLE width="478" border="1" cellspacing="0" cellpadding="0" cool gridx="16" gridy="16" height="343" showgridx showgridy usegridx usegridy>

<TBODY>

<TR height="32">

<TD height="342" rowspan="4" width="268"><IMG name=bigimg src="bigimg.jpg"></TD>

</TR>

...
Copy linkTweet thisAlerts:
@russ801authorMar 12.2003 — What happens when you leave the SRC out and just use the name? I saw an example using this.

<SCRIPT language="JavaScript1.2">


var photos = new Array(

new Array("Images/MarH0022V.jpg", "Images/MarH0022T.jpg","Images/MarH0022C.jpg"),

new Array("Images/NicM0421V","Images/NicM0421T",null),

new Array("Message-3W.jpg", null,null),

new Array("Message-1W.jpg","Message-3W.jpg",null)

);


var bigimg= new Image()

bigimg.src=photos[1]

</SCRIPT></HEAD>

<BODY bgcolor="#474747">

<TABLE width="478" border="1" cellspacing="0" cellpadding="0" cool gridx="16" gridy="16" height="343" showgridx showgridy usegridx usegridy>

<TBODY>

<TR height="32">

<TD height="342" rowspan="4" width="268"><IMG name=bigimg src=""></TD>


...
×

Success!

Help @russ801 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...