SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Center Lightbox in Viewport for Horizontally scrolling site

    http://tend.wpengine.com/gallery/gre.../centerpieces/

    See how when you scroll to the right and click on a thumbnail the lightbox is moving off screen to the left? Any way around this?

  2. #2
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Hey Extravaganza,

    This happens because the width of the lightbox container is set to 100% width and positioned absolutely. The 100% width is of course the viewport width and not the document width, so when you start scrolling right, it gets left behind on the left.

    To fix this you could make the container div (#slb_viewer) fixed by changing "position:absolute;" to "position:fixed;". This should keep it visible in the viewport when scrolling
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A very belated thank you


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
  •