Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Location
    England
    Posts
    132
    Thanks
    24
    Thanked 0 Times in 0 Posts

    Unhappy Need Help With Simple Divviewer Image Viewer

    I need help implementing what appears to be a simple javascript :

    http://www.javascriptkit.com/script/...ivviewer.shtml

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

    Code:
    <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:

    Code:
    <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 :

    Code:
    <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>

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Code:
    <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>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Regular Coder
    Join Date
    Jul 2007
    Location
    England
    Posts
    132
    Thanks
    24
    Thanked 0 Times in 0 Posts
    Thanks Glenn. On mouse click it gives the error :

    Line 27
    Error : 'dv' is undefined
    Code : 0
    Code:
    <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>

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    The script start tag which includes DV.js is missing.
    Code:
    <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>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    Regular Coder
    Join Date
    Jul 2007
    Location
    England
    Posts
    132
    Thanks
    24
    Thanked 0 Times in 0 Posts
    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!

  • #6
    New to the CF scene
    Join Date
    Apr 2010
    Location
    North Yorkshire
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    divviewer image viewer probs

    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??

    Code:
    <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>

  • #7
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,518
    Thanks
    3
    Thanked 506 Times in 493 Posts
    tested with IE7 and FF

    Code:
    <!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>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #8
    New to the CF scene
    Join Date
    Apr 2010
    Location
    North Yorkshire
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up cheeeeeeeeeers

    thanks a million! What did I do wrong? It's not that obvious to me looking at it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •