/    Sign up×
Community /Pin to ProfileBookmark

hi,
i’m using this code a fellow member gave me

[code=php]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Language” content=”en-gb”>
<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1252″>
<title>Home</title>
<style type=”text/css”>
<!–
body {
background-color: #CCCCCC;
}
–>
</style>
<script>
function changeimage(towhat,url){
if (document.images){
document.images.targetimage.src=towhat.src
gotolink=url
}
}
function warp(){
window.location=gotolink
}

</script>
<script language=”JavaScript1.1″>
var myimages=new Array()
var gotolink=”#”

function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}

preloadimages(“image1.gif”,”image2.gif”,”image3.gif”,”image4.gif”,”image5.gif”)
</script>
</head>

<body>
<table width=”100%” height=”100%” border=”1″ cellpadding=”0″ cellspacing=”0″ bgcolor=”#F0F0F0″>
<tr>
<td width=”16%” valign=”bottom”><table width=”100%” height=”217″ border=”1″ cellpadding=”0″

cellspacing=”0″>
<tr>

<td><a href=”javascript:warp()”><img src=”plane0.gif” name=”targetimage” border=0></a></td>
</tr>
</table></td>
<td width=”56%” valign=”top”>
<p align=”center”>
<a href=”image1link.htm” onMouseover=”changeimage(myimages[0],this.href)”>Image 1</a>
<br><a href=”image2link.htm” onMouseover=”changeimage(myimages[1],this.href)”>Image 2</a>
<br><a href=”image3link.htm” onMouseover=”changeimage(myimages[2],this.href)”>Image 3</a>
<br><a href=”image4link.htm” onMouseover=”changeimage(myimages[3],this.href)”>Image 4</a>
<br><a href=”image5link.htm” onMouseover=”changeimage(myimages[4],this.href)”>Image 5</a></td>

<td width=”28%”>&nbsp;</td>
</tr>
</table>
</body>
</html>
[/code]

and i want the user to ONLY be able to click the picture to open the link, not the text, because i want the text to have the onclick function and the picture changes, thanks alot!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JAug 07.2005 — Try ....

Change

<a href="javascript:warp()"><img src="plane0.gif" name="targetimage" border=0></a>

to

<img src="plane0.gif" name="targetimage" border=0 onclick="warp()">

Change your links from

<a href="image1link.htm" onclick="changeimage(myimages[0],this.href)">Image 1</a>

to

<a href="image1link.htm" onMouseover="changeimage(myimages[0],this.href)">Image 1</a>
×

Success!

Help @al_90 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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