Results 1 to 4 of 4

Thread: Lightbox not working in Chome/Safari (with imagemap?) Help please! :)

  1. #1
    Join Date
    May 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Lightbox not working in Chome/Safari (with imagemap?) Help please! :)

    Ok, so first off, I'm a noob.

    I recently put together my own site using Dreamweaver (and various tutorials) to try to get everything working. So far I've got IE and Firefox on board, but I can't get LightBox to work in Chrome and Safari correctly.

    The problem page: http://thepaulemerson.com/photos.html

    The user should be able to click a picture on the iPhone which should engage the LightBox script and show the photo (of course). I'm pretty sure that the problem lies with the fact that I am using an image map, although FF and IE don't take issue with it.

    Please help! Thank you in advance!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    First off, because this and similar:

    Code:
    <a href="images/photo pics/1.jpg" rel="lightbox[paulpics]"><area shape="poly" coords="488,143,490,204,550,202,548,141" href="#" /></a>
    are invalid HTML code, Safari and Chrome don't even know you want to open a lightbox. It should be:

    Code:
    <area shape="poly" rel="lightbox[paulpics]" coords="488,143,490,204,550,202,548,141" href="images/photo pics/1.jpg" />
    Fix the others accordingly as well. You cannot have a link inside of a map.

    Once you fix that though, there will still be problems. Find this in lightbox.js (starting around line 200 in that file) and add the highlighted line as seen below:

    Code:
        //
        //  start()
        //  Display overlay and lightbox. If image is part of a set, add siblings to imageArray.
        //
        start: function(imageLink) {    
    
            $$('select', 'object', 'embed').each(function(node){ node.style.visibility = 'hidden' });
    
            // stretch overlay to fill page and fade in
            var arrayPageSize = this.getPageSize();
            $('overlay').setStyle({ width: arrayPageSize[0] + 'px', height: arrayPageSize[1] + 'px' });
    
            new Effect.Appear(this.overlay, { duration: this.overlayDuration, from: 0.0, to: LightboxOptions.overlayOpacity });
    
            this.imageArray = [];
            var imageNum = 0;       
            imageLink.rel = imageLink.getAttribute('rel', 0);
            if ((imageLink.rel == 'lightbox')){
                // if image is NOT part of a set, add single image to imageArray
                this.imageArray.push([imageLink.href, imageLink.title]);         
            } else {
                // if image is part of a set..
                this.imageArray = 
                    $$(imageLink.tag . . .
    That's it. Enjoy!
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    cellulove (05-11-2010)

  4. #3
    Join Date
    May 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    John, I can't thank you enough for all of your help!
    I am very, very appreciative!

  5. #4
    Join Date
    May 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thank you!

    This really saved me. Thanks for the tip.

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
  •