Results 1 to 5 of 5

Thread: Lightbox Opera problem.

  1. #1
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default Lightbox Opera problem.

    Ok really strange, lightbox is working in IE and FF but in Opera, the overlay loads up and then it stops loading, but no image comes up, just the overlay, what the hell is up with it? Really confusing.

    Link to page here: http://bristoldnb.co.uk/

    Just click on any of the "flyer" links and you'll see the problem.

    Edit: Ok, I've realised the image does show up, but you have to scroll down a fair bit, still something wrong though =/

    Any advice on how to fix this?
    Last edited by Schmoopy; 01-11-2009 at 06:11 PM.

  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

    I can say that it is at least partly due to the unusual layout, perhaps also in part due to one or more of Opera's generally unique (though often more standard) approaches to interpreting javascript and style.

    You (or someone) would basically have to trace through the lightbox code to find where Opera should branch and to what to get the desired result, that or use a more basic layout.

    In the lightbox script, it would probably be a place or places where the top style property is being set, and/or that the height of the page/window is being determined that needs tweaking for Opera with this layout.

    In case you don't already know this, Opera may be made to exclusively follow:

    Code:
    if (window.opera){
    /* do Opera only stuff here */
    }
    Last edited by jscheuer1; 01-11-2009 at 06:13 AM. Reason: add the bit about the height of the page/window
    - John
    ________________________

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

  3. #3
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Ok, well since I'm not really a JavaScript guru I can see what you mean and I can see that the top style property is being set in the following code:

    Code:
            // calculate top and left offset for the lightbox 
            var arrayPageScroll = document.viewport.getScrollOffsets();
            var lightboxTop = arrayPageScroll[1] + (document.viewport.getHeight() / 10);
            var lightboxLeft = arrayPageScroll[0];
            this.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show();
            
            this.changeImage(imageNum);
    But wouldn't really know where to go from here after putting in the if (window.opera) { }

  4. #4
    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

    Code:
            // calculate top and left offset for the lightbox 
            var arrayPageScroll = document.viewport.getScrollOffsets();
            var lightboxTop = arrayPageScroll[1] + ((window.opera? window.innerHeight : document.viewport.getHeight()) / 10);
            var lightboxLeft = arrayPageScroll[0];
            this.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show();
    - John
    ________________________

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

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

    Schmoopy (01-11-2009)

  6. #5
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Great, fixed

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
  •