SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    UK
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jquery lightbox problems in Internet Explorer

    Hi.
    I am using the lightbox script from "Jquery:Novice to Ninja" and it works very well in Firefox and Opera but not in IE8.
    The problem, I think is because I am using PHP to pull the picture names from a file. There are around 40 pictures so I didn't want to name them all manually.
    The PHP script is here;-

    $jpgs = glob("gallery_images/*.jpg");

    foreach ($jpgs as $jpg)
    {
    $file = basename($jpg, ".jpg");

    echo("<li><a href='gallery_images/$file.jpg' class='lightbox'><img src='gallery_images/$file.jpg' width='200' height='130'></a>$file</a></li>");
    }

    This easily produces a nice page of thumbnails and clicking on any brings up the bigger picture in lightbox but not in IE.
    It seems that IE needs another set of pictures to load from so the filename od the <a href=image> needs to be different to the <src=image> filename which makes more work.
    Is there a work around to make this work as well in IE as it does in firefox.
    The page can be seen at http://tinyurl.com/66axyny
    Also as an aside. When the lightbox starts it removes the scroll bar which has the effect of moving the page to the right. Is there a way to add a right margin to replace the scroll bar to stop this happening?

    Thanks.

    John.

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    UK
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Problem solved

    Following this post I did notice the extra </a>
    in echo("<li><a href='gallery_images/$file.jpg' class='lightbox'><img src='gallery_images/$file.jpg' width='200' height='130'></a>$file</a></li>");
    but taking this out made no difference to how it works in IE.

    However, the work around was simply to duplicate the pictures in another folder so the different address made it looked like a different picture to IE. Not a very elegant solution but it works.

    John.


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
  •