Results 1 to 2 of 2

Thread: image disappear when clicking ?

  1. #1
    Join Date
    Oct 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default image disappear when clicking ?

    Hi,
    i'm developing an image gallery.
    i've added an option to change to border of a thumbnail (to highlight) when clicking.
    so i've added onclick="selectPic(this.id)" and it calls this function:

    function selectPic(id){
    var length=document.images.length;

    for (var i=0;i<length;i++){
    document.images[i].style.border='black solid 1px';
    }
    document.getElementById(id).style.border='red solid 3px';
    }

    now , the problem is , it works but sometimes , without any rules.. i get this error message "'document.images[...].style' is null or not an object"
    and the thumbnail disappear!

    i'm using ie 6 and i'm using AJAX to show the thumbnails.

    thanks.

  2. #2
    Join Date
    Oct 2006
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    um, just a guess, but try redefining the image file when calling onClick, makes sense to me at least

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
  •