Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 7 of 7

This is a discussion on Javascript Help ! Sorry if wrong forum in the Open Discussion & Chit-chat forum
Sorry, I didn't quite know what forum to post this topic in. But I'll just post it here. I'm trying to create a image gallery ...

  1. #1
    Jag Veteran dkadave's Avatar
    Join Date
    Sep 2001
    Location
    California, from Hawaii! Gotta love the ocean...
    Posts
    558

    Javascript Help ! Sorry if wrong forum

    Sorry, I didn't quite know what forum to post this topic in. But I'll just post it here.

    I'm trying to create a image gallery where you have an image and then a collection of images below it. And when you click on the image it loads the image clicked on ontop of the other image.

    IE Browser is not supported.


    http://rctfan.dkanet.com/enter.php


    Click on Screen Shots.

    Ok, I don't have a problem getting the images to load but in my browser when I click on an image. The progress bar stays green as it seems to me that's it's still loading or something.

    I don't know what the problem is.

    Here is an example of the code

    javascript:changescreen("01");

    Here is the Javascript code:

    function changescreen(sfile) {
    ssfile = "screens/"+sfile+"l.jpg";
    if (document.getElementById) {
    document.getElementById('screenshots').s rc = ssfile;
    } else if (document.all) {
    document.all.screenshots.src = ssfile;
    }
    }

    Thanks,
    David
    ------------------------------------------------------------------------------------------------
    http://www.dkanet.com - http://www.vi01.com
    http://www.dkahost.com
    ------------------------------------------------------------------------------------------------
    AIM: dkadave - YIM: dkadave
    E-mail: dkanet@dkanet.com
    ------------------------------------------------------------------------------------------------

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    I would do it something like this:

    First, name the large image something. I'll call it "mainImg" here.

    <img src="path/to/default/image" height="?" width="?" name="mainImg" id="mainImg">

    Next, add your thumbnails. Give each a link with an onclick event that calls a function called changeImg(). Pass an identifier to changeImg(). I'm using javascript:void('') for the href of the link to prevent the browser from trying to load a new page.

    <a href="javascript:void('');" onclick="changeImg(1);"><img src="/path/to/thumbnail" width=="?" height="?"></a>

    Now add the function to a <script> block in the <head> or your page:

    Code:
    function changeImg(id) {
        if(document.images) {
            document.images["mainImg"].src = "/path/to/image" + id + ".jpg";
        }
    }
    Not tested, but it uses the same principle as most of the rollover code that's out there and should work in virtually every browser since at least Netscape 4.

    Good luck.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  3. #3
    Jag Veteran dkadave's Avatar
    Join Date
    Sep 2001
    Location
    California, from Hawaii! Gotta love the ocean...
    Posts
    558
    thanks will try that...
    ------------------------------------------------------------------------------------------------
    http://www.dkanet.com - http://www.vi01.com
    http://www.dkahost.com
    ------------------------------------------------------------------------------------------------
    AIM: dkadave - YIM: dkadave
    E-mail: dkanet@dkanet.com
    ------------------------------------------------------------------------------------------------

  4. #4
    Jag Veteran dkadave's Avatar
    Join Date
    Sep 2001
    Location
    California, from Hawaii! Gotta love the ocean...
    Posts
    558
    Tried that, same problem. The progress bar just keeps running... Still says transfering data...
    ------------------------------------------------------------------------------------------------
    http://www.dkanet.com - http://www.vi01.com
    http://www.dkahost.com
    ------------------------------------------------------------------------------------------------
    AIM: dkadave - YIM: dkadave
    E-mail: dkanet@dkanet.com
    ------------------------------------------------------------------------------------------------

  5. #5
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Could you post a link so I could see what you're trying to do?

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  6. #6
    Jag Veteran dkadave's Avatar
    Join Date
    Sep 2001
    Location
    California, from Hawaii! Gotta love the ocean...
    Posts
    558
    It was posted above as well. But I now see that something happened and the link doesn't work. hmmm...

    http://rctfan.dkanet.com/enter.php

    Click on screenshots. And then click an image thumbnail.

    Please note site doesn't work in IE.
    ------------------------------------------------------------------------------------------------
    http://www.dkanet.com - http://www.vi01.com
    http://www.dkahost.com
    ------------------------------------------------------------------------------------------------
    AIM: dkadave - YIM: dkadave
    E-mail: dkanet@dkanet.com
    ------------------------------------------------------------------------------------------------

  7. #7
    Jag Veteran dkadave's Avatar
    Join Date
    Sep 2001
    Location
    California, from Hawaii! Gotta love the ocean...
    Posts
    558
    found the problem it's a problem with the newer versions of mozilla.
    ------------------------------------------------------------------------------------------------
    http://www.dkanet.com - http://www.vi01.com
    http://www.dkahost.com
    ------------------------------------------------------------------------------------------------
    AIM: dkadave - YIM: dkadave
    E-mail: dkanet@dkanet.com
    ------------------------------------------------------------------------------------------------

Bookmarks

Posting Permissions

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