/    Sign up×
Community /Pin to ProfileBookmark

swap images by link with javascrupt

hey im new here ?
i have this code and it works like i want in explorer but not in mozila it doesnt keep the center.
the code is:

[CODE]

<html>
<head>

<script type=”text/javascript”>

/***********************************************
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Specify image paths and optional link (set link to “” for no link):
var dynimages=new Array()
dynimages[0]=[“photo1.jpg”, “http://www.cnn.com”]
dynimages[1]=[“images/1.jpg”, “http://www.yahoo.com”]
dynimages[2]=[“images/2.jpg”, “http://www.google.com”]
dynimages[3]=[“images/3.jpg”, “http://www.google.com”]
dynimages[4]=[“images/4.jpg”, “http://www.google.com”]
dynimages[5]=[“images/5.jpg”, “http://www.google.com”]
dynimages[6]=[“images/6.jpg”, “http://www.google.com”]
dynimages[7]=[“images/7.jpg”, “http://www.google.com”]
dynimages[8]=[“images/8.jpg”, “http://www.google.com”]

//Preload images (“yes” or “no”):
var preloadimg=”no”

//Set optional link target to be added to all images with a link:
var optlinktarget=””

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring=”progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)”

///////No need to edit beyond here/////

if (preloadimg==”yes”){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}

function returnimgcode(theimg){
var imghtml=””
if (theimg[1]!=””)
imghtml='<a href=”‘+theimg[1]+'” target=”‘+optlinktarget+'”>’
imghtml+='<img src=”‘+theimg[0]+'” border=”‘+imgborderwidth+'”>’
if (theimg[1]!=””)
imghtml+='</a>’
return imghtml
}

function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring

}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}

</script>
</head>

<body>

<table align=”center” width=”700″ height=”500″ border=”1″ cellpadding=”0″ cellspacing=”0″>

<tr>
<td width=”500″ height=”500″ rowspan=”6″ align=”center”>
<div id=”dynloadarea2″ style=”width:80px;height:200px”></div>
</td>
<td colspan=”2″ height=”20″>
9

</td>
</tr>
<tr>
<td width=”100″>
<a href=”#” onClick=”return modifyimage(‘dynloadarea2’, 1)”><img src=”images/1.JPG” height=”100″ width=”100″></a>
</td>
<td width=”100″>
<a href=”#” onClick=”return modifyimage(‘dynloadarea2’, 2)”><img src=”images/2.JPG” height=”100″ width=”100″></a>
</td>
</tr>

<tr>
<td width=”100″>
<a href=”#” onClick=”return modifyimage(‘dynloadarea2’, 3)”><img src=”images/3.JPG” height=”100″ width=”100″></a>
</td>
<td width=”100″>
<a href=”#” onClick=”return modifyimage(‘dynloadarea2’, 4)”><img src=”images/4.JPG” height=”100″ width=”100″></a>
</td>
</tr>

<tr>
<td width=”100″>
<a href=”#” onClick=”return modifyimage(‘dynloadarea2’, 5)”><img src=”images/5.JPG” height=”100″ width=”100″></a>
</td>
<td width=”100″>
<a href=”#” onClick=”return modifyimage(‘dynloadarea2’, 6)”><img src=”images/6.JPG” height=”100″ width=”100″></a>
</td>
</tr>

<tr>
<td width=”100″>
<a href=”#” onClick=”return modifyimage(‘dynloadarea2’, 7)”><img src=”images/7.JPG” height=”100″ width=”100″></a>
</td>
<td width=”100″>
<a href=”#” onClick=”return modifyimage(‘dynloadarea2’, 8)”><img src=”images/8.JPG” height=”100″ width=”100″></a>
</td>
</tr>

<tr>
<td colspan=”2″ height=”20″>
9
</td>
</tr>

</table>

<BR><BR><BR><BR><BR><BR><BR>
</body>
</html>
[/CODE]

thanks for any help ?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@minowauthorApr 20.2006 — someone anyone?
×

Success!

Help @minow 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.21,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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