...

View Full Version : Need Help With Simple Divviewer Image Viewer



Mehdi72
07-19-2007, 08:47 PM
I need help implementing what appears to be a simple javascript :

http://www.javascriptkit.com/script/script2/divviewer.shtml



Directions: Add the below script to the HEAD section of your page:



<script src="DV.js" type="text/javascript">

/***********************************************
* Pagination Combo Box- by Axel Schneider (http://axelschneider.info/)
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
* Please keep this notice intact
***********************************************/

</script>

<script type="text/javascript">
//Define your images using arbitrary variables, to be passed in as arguments later down the page:
var bigbaby = '<img src="bigbaby.jpg" width="1075" height="717" border="0" alt="">'
var pancake = '<img src="food1.jpg" width="300" height="375" border="0" alt="">'

</script>
<script src="DV.js" type="text/javascript">

/***********************************************
* Pagination Combo Box- by Axel Schneider (http://axelschneider.info/)
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
* Please keep this notice intact
***********************************************/

</script>

<script type="text/javascript">
//Define your images using arbitrary variables, to be passed in as arguments later down the page:
var bigbaby = '<img src="bigbaby.jpg" width="1075" height="717" border="0" alt="">'
var pancake = '<img src="food1.jpg" width="300" height="375" border="0" alt="">'

</script>
<script src="DV.js" type="text/javascript">

/***********************************************
* Pagination Combo Box- by Axel Schneider (http://axelschneider.info/)
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
* Please keep this notice intact
***********************************************/

</script>

<script type="text/javascript">
//Define your images using arbitrary variables, to be passed in as arguments later down the page:
var bigbaby = '<img src="bigbaby.jpg" width="1075" height="717" border="0" alt="">'
var pancake = '<img src="food1.jpg" width="300" height="375" border="0" alt="">'

</script>
<script src="DV.js" type="text/javascript">

/***********************************************
* Pagination Combo Box- by Axel Schneider (http://axelschneider.info/)
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
* Please keep this notice intact
***********************************************/

</script>

<script type="text/javascript">
//Define your images using arbitrary variables, to be passed in as arguments later down the page:
var bigbaby = '<img src="bigbaby.jpg" width="1075" height="717" border="0" alt="">'
var pancake = '<img src="food1.jpg" width="300" height="375" border="0" alt="">'

</script>


You also need to download the below external JavaScript file:

DV.js

Then, to create a link that pops up an image when clicked on, do the following:



<a href="#" onClick="dv.showDV(pancake); return false">pancakes</a>


Where pancake is the variable containing the image tag to be shown (see code in your HEAD section.

Obviously this works on image links as well.


I do not need a text link, I want the image to be displayed on a mouse click over the thumbail. I have tried to incorporate the HTML as follows :



<html>
<head>
<TITLE>Test</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="Description" CONTENT="Test">


/***********************************************
* Pagination Combo Box- by Axel Schneider (h**p://axelschneider.info/)
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
* Please keep this notice intact
***********************************************/

</script>

<script type="text/javascript">
//Define your images using arbitrary variables, to be passed in as arguments later down the page:
var image = src="Images/SNICTI__Stationery_1_by_caprozo.jpg" width="2133" height="1600" border="0" alt="">'
</script>
</head>

<body bgcolor="#000000" text="#000000">

<body bgcolor="#000000" vlink="#000000" alink="#0000FF" link="#000000">
<font size="3" face="Tahoma">
<div align="center">
<center>

<p>
<img src="Images/SNICTI__Stationery_1_by_caprozo_small.jpg" width="100" height="100" border="0"></p>
</center>
</div>

</font>
<p>
</body>
</html>

glenngv
07-19-2007, 09:09 PM
<script type="text/javascript">
//Define your images using arbitrary variables, to be passed in as arguments later down the page:
var image = '<img src="Images/SNICTI__Stationery_1_by_caprozo.jpg" width="2133" height="1600" border="0" alt="">';
</script>
...
<a href="#" onclick="dv.showDV(image); return false"><img src="Images/SNICTI__Stationery_1_by_caprozo_small.jpg" width="100" height="100" border="0"></a>

Mehdi72
07-19-2007, 09:45 PM
Thanks Glenn. On mouse click it gives the error :



Line 27
Error : 'dv' is undefined
Code : 0




<html>
<head>
<TITLE>Test</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="Description" CONTENT="Test">


/***********************************************
* Pagination Combo Box- by Axel Schneider (h**p://axelschneider.info/)
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
* Please keep this notice intact
***********************************************/

</script>

<script type="text/javascript">
//Define your images using arbitrary variables, to be passed in as arguments later down the page:
var image = '<img src="Images/SNICTI__Stationery_1_by_caprozo.jpg" width="2133" height="1600" border="0" alt="">';
</script>

</head>

<body bgcolor="#000000" vlink="#000000" alink="#0000FF" link="#000000">
<div align="center">
<center>

<a href="#" onclick="dv.showDV(image); return false"><img src="Images/SNICTI__Stationery_1_by_caprozo_small.jpg" width="100" height="100" border="0"></a>

</body>
</html>

glenngv
07-19-2007, 11:01 PM
The script start tag which includes DV.js is missing.

<META NAME="Description" CONTENT="Test">
<script src="DV.js" type="text/javascript">

/***********************************************
* Pagination Combo Box- by Axel Schneider (http://axelschneider.info/)
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
* Please keep this notice intact
***********************************************/

</script>

Mehdi72
07-19-2007, 11:32 PM
Thanks that did it. I need to set the tags for about 30 images on a page so if I get stuck I'll be in touch!

makkka
04-30-2010, 10:19 PM
Hi, I'm also having probs with this script:

I have done the same as you suggested but I get an 'object undefined' message when I click a thumbnail. Can you help??


<META NAME="Description" CONTENT="Test">
<script src="http://www.homestead.com/equishots/files/DV.js" type="text/javascript">

/***********************************************
* Pagination Combo Box- by Axel Schneider (http://axelschneider.info/)
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
* Please keep this notice intact
***********************************************/

</script>

<script type="text/javascript">
//Define your images using arbitrary variables, to be passed in as arguments later down the page:
var image = '<img src="http://www.homestead.com/equishots/files/Kauto_iframepage.jpg" width="540" height="420" border="0" alt="">';

</script>

<a href="#" onClick="dv.showDV(image); return false"><img border="1" src="http://www.homestead.com/equishots/files/Kauto144-160opt.jpg" width="160" height="118"></a>

vwphillips
05-01-2010, 12:50 PM
tested with IE7 and FF


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
</head>

<body>
<script type="text/javascript">
//Define your images using arbitrary variables, to be passed in as arguments later down the page:
var image = '<img src="http://www.homestead.com/equishots/files/Kauto_iframepage.jpg" width="540" height="420" border="0" alt="">';

</script>

<a href="#" onClick="dv.showDV(image); return false"><img border="1" src="http://www.homestead.com/equishots/files/Kauto144-160opt.jpg" width="160" height="118"></a>

<script src="http://www.homestead.com/equishots/files/DV.js" type="text/javascript">

/***********************************************
* Pagination Combo Box- by Axel Schneider (http://axelschneider.info/)
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
* Please keep this notice intact
***********************************************/

</script>


</body>

</html>

makkka
05-01-2010, 03:39 PM
thanks a million! What did I do wrong? It's not that obvious to me looking at it.:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum