Targetpractice2
03-22-2009, 10:13 AM
1) Script Title: Image Thumbnail Viewer II
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm
3) Describe problem:
Hi Folks,
First post on this forum and my first attempt at using a little Javascript.
Plenty posts about this script but couldnt find anything exactly like this so appologies if its there already.
I copied and pasted the code and tried it two different ways 1) put the script into the header and 2) created a separate JS file. On both occasions the image loads but appears in a different page not in the related DIV.
I am not a JS user at all so again sorry if this is simple.
heres whats on my html page (external CSS ) its just a blank html page to test out the application before moving onto my actual website.
[code]
<head>
<title>Untitled Page</title>
<script language="JavaScript" src="/thumbnailviewer2.js" type="text/javascript" defer> /*note defer something wrong here?*/
//Code on JavaScript
</script>
<link rel="stylesheet" type="text/css" href="StyleSheet.css" media="screen" />
</head>
<body>
<a href= "images/thumnailporch.jpg" rel="enlargeimage::click" rev="loadarea">Thumbnail
</a><br /><br />
<div id="loadarea" >this is loadarea</div>
<h2 />
<div id="loadarea2">
this is load area two</div>
</body>
</html>
[code]
Note on my external css file I have referenced the div ids to loadarea and loadarea2 just to keep it the same as your file and given them a height and width with a background colour, they display and so do the text and thumbnail. Secondly I have changed the el="enlargeimage:: to "click".
The text/thumbnail when clicked is launching the related larger image but not in the DIV. So it appears as though I have not linked correctly the div?
I assume however that ref="loadarea" is the name of the related div?
as I say I dont work with JS so appologies if this is V simp.
TP
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm
3) Describe problem:
Hi Folks,
First post on this forum and my first attempt at using a little Javascript.
Plenty posts about this script but couldnt find anything exactly like this so appologies if its there already.
I copied and pasted the code and tried it two different ways 1) put the script into the header and 2) created a separate JS file. On both occasions the image loads but appears in a different page not in the related DIV.
I am not a JS user at all so again sorry if this is simple.
heres whats on my html page (external CSS ) its just a blank html page to test out the application before moving onto my actual website.
[code]
<head>
<title>Untitled Page</title>
<script language="JavaScript" src="/thumbnailviewer2.js" type="text/javascript" defer> /*note defer something wrong here?*/
//Code on JavaScript
</script>
<link rel="stylesheet" type="text/css" href="StyleSheet.css" media="screen" />
</head>
<body>
<a href= "images/thumnailporch.jpg" rel="enlargeimage::click" rev="loadarea">Thumbnail
</a><br /><br />
<div id="loadarea" >this is loadarea</div>
<h2 />
<div id="loadarea2">
this is load area two</div>
</body>
</html>
[code]
Note on my external css file I have referenced the div ids to loadarea and loadarea2 just to keep it the same as your file and given them a height and width with a background colour, they display and so do the text and thumbnail. Secondly I have changed the el="enlargeimage:: to "click".
The text/thumbnail when clicked is launching the related larger image but not in the DIV. So it appears as though I have not linked correctly the div?
I assume however that ref="loadarea" is the name of the related div?
as I say I dont work with JS so appologies if this is V simp.
TP