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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Adding Image Size variables to script?

    Howdy all. I found this great JavaScript for displaying images. It allows you to use unlimited thumbnails, which when pressed, replace the main image with the selected one. It works great in Explorer, unfortunately in Netscape it forces the new images to the same height and width of the previous (main) image. I've been playing with it for several days, but have been unable correct this problem. Here's the code:



    <head>
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    browserName = navigator.appName;
    browserVer = parseInt(navigator.appVersion);

    ns3up = (browserName == "Netscape" && browserVer >= 3);
    ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);

    function doPic(imgName) {
    if (ns3up || ie4up) {
    imgOn = ("" + imgName);
    document.mainpic.src = imgOn;
    }
    }
    // End -->
    </script></head>

    then when linking the thumbnail to the new image I wish to have display

    <a href="javascript:doPic('image2.jpg');"><img src="image.jpg"></a>

    What I'm trying to figure out how to do, is add control of the height and width to image2.jpg. Any ideas?

    ....Thankyou kindly....TheChiaroscurist

  • #2
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fulls script.

    Silly me, wasn't paying close enough attention. Here is a link to an example and full code of the script.

    http://javascript.internet.com/misce...ry-viewer.html

    Thankyou again,... TheChiaroscurist


  •  

    Posting Permissions

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