/    Sign up×
Community /Pin to ProfileBookmark

How can I make multiple thumbnail images show a full-size image in another table cell?

Example site: [url]http://www.allamericanrejects.com/photos/index.asp[/url]

No mouseOVer/rollOvers

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@rwhittenJul 17.2004 — Try the following.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Untitled</title>

<script language="JavaScript" type="text/javascript">

<!--

// THIS CHANGES PICTURES WHEN LEFT TABLE CELLS ARE CLICKED

function changepicture(newpic){

document.getElementById('targetcell').innerHTML="<img src='"+newpic+"' />";

}

//-->

</script>

</head>

<table summary="">

<tr>

<td onclick="changepicture('firstpic.jpg')"><img src="firstpic_th.jpg" alt=""></td>

<td rowspan="4" id="targetcell"></td>

</tr>

<tr>

<td onclick="changepicture('secondpic.jpg')"><img src="secondpic_th.jpg" alt=""></td>

</tr>

<tr>

<td onclick="changepicture('thirdpic.jpg')"><img src="thirdpic_th.jpg" alt=""></td>

</tr>

<tr>

<td onclick="changepicture('fourthpic.jpg')"><img src="fourthpic_th.jpg" alt=""></td>

</tr>

</table>

<script language="JavaScript" type="text/javascript">

<!--

//SETS THE INITIAL PICTURE. PUT THIS SOMEWHERE AFTER THE TABLE SO IT CAN LOAD FIRST

document.getElementById("targetcell").innerHTML="<img src='firstpic.jpg' />";

//-->

</script>

</body>

</html>
Copy linkTweet thisAlerts:
@fredmvJul 17.2004 — Welcome to the forums.

The previous suggestion is inaccessible; it will not work when JavaScript isn't available.

Instead use:

[upl-file uuid=0f7a6cb5-68f7-42e3-940a-9c824cf448fd size=5kB]gallery.txt[/upl-file]
×

Success!

Help @Nocturnal_Enemy 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.6,
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,
)...