Jump to content

masking the page


michaellunsford

Recommended Posts

pretty simple CSS thing I've seen done on a number of sites. You click an image, and a div "pops" up with a close "X" in the top right corner. Usually, the rest of the site behind the popup is masked with a 60% opacity.

 

So, I built one and it works great -- except my background mask isn't working quite right. It's set to height:100% -- if the page has a scroll bar and the user scrolls down, the 100% high mask ended at the bottom of the screen (not the page). So, they can scroll past the mask.

 

The masks I've seen out there just have jquery apply a specific pixel height to the mask. I'm curious if there's a CSS-only way to do this. So far, I've not been successful. Thoughts?

Link to comment
Share on other sites

Yep, I should have thought of fixed -- it actually fixes a few glitches I'm having. Fixed seems to be a challenge for iOS devices, though. I guess I'd have to rely on jquery in that case, though. Right?

If you want the overlay to appear on the click of something, then yeah... you'll have to use jQuery, or JavaScript if you're old fashioned like that.

Link to comment
Share on other sites

If you want the overlay to appear on the click of something, then yeah... you'll have to use jQuery, or JavaScript if you're old fashioned like that.

 

Not to fire the event -- but for layout. iOS devices don't support "position:fixed" -- the elements just appear at the bottom of the page (based on their appearing last in the html code).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.