...

View Full Version : Disable page.



flynch01
02-25-2008, 10:19 PM
I have a page, and when the use clicks on a link, it shows a div. But I want to make it so that the rest of the page under the div get's disabled, cant be clicked or scrolled. I'm sure you've seen something like this before. I'm not sure what i'm supposed to use, so i'm hoping html/css is the right place.

jcdevelopment
02-25-2008, 10:57 PM
do you have an example page where you have seen this. It sounds like a jasvascript problem.

flynch01
02-25-2008, 11:04 PM
Don't worry I figured it out. Or at least I have a plan, if it doesn't work i'll be back:

THE PLAN!!!!:

Create a div to fille the page, and color it grey. Set it's z-index to 0, everything else to 1. When the div I want to show pops up, I set it's z-index to 3, and the grey div to 2. That way, the div covers everything, and takes all the mouse input. Job done, or so I hope. 2 minutes thanks.

_Aerospace_Eng_
02-25-2008, 11:09 PM
Kind of like thickbox (http://jquery.com/demo/thickbox/)? Check out the demos.

flynch01
02-25-2008, 11:18 PM
Yes like that, but I don't want something I havn't made on here unless it's... really impossible for me to do. Also, thats way too much, I just want to shade the background so my div is there. Anyway question is:


#pageCover {
width: 100%;
height: 100%;
background: orange;
position: absolute;
top: 0px;
left: 0px;
z-index: 3;
}

It only stretches as high as the page thats visible, so if you scroll down you can see the page. Is there a way to make it stretch the full length of the actual page, i know there is a javascript way. But before I jump at it is there a simple css property?

_Aerospace_Eng_
02-25-2008, 11:27 PM
Make it position:fixed. IE6 doesn't support position:fixed; so you will need to fake it. http://www.cssplay.co.uk/layouts/fixed.html

flynch01
02-25-2008, 11:38 PM
That kindof, causes other problems. Ok no worries i'll javascript it.

flynch01
02-26-2008, 12:26 AM
Sorry to keep replying but, how do I disable scrolling? I want to do it temporarily.

_Aerospace_Eng_
02-26-2008, 12:44 AM
You can use javascript.

document['body'].style.overflow = 'hidden';

flynch01
02-26-2008, 01:06 AM
Nice. All works nice now. :D

neetlife.co.uk/design/

Edit: Oh wait... the screen flashes white and jumps all over if you've scrolled down the page. Is there no other way to just disable scrolling?

Another Edit: Never mind, i'll just force it to scroll to the top first.

YET another edit: I don't like the fact the scroll bars disappear, is there no way to just capture and block the scroll wheel?

_Aerospace_Eng_
02-26-2008, 04:55 AM
No there is no way to capture the scroll bar and block the scroll wheel. What exactly are you trying to do anyways? I got the idea of overlay but why stop scrolling?

flynch01
02-26-2008, 05:21 AM
Well

neetlife.co.uk/design

If you scroll down slightly (i already know that the div to cover the page is visible, i'll fix later) and then click on one of the download buttons. It'll scroll to the top of the page and cover everything with the div. Thing is the scrollbar disappears and it makes everything jerk. I didn't like it.

_Aerospace_Eng_
02-26-2008, 05:27 AM
I understand that but there isn't much you can do about that. What exactly are you trying to do? Why the need to not scroll?

flynch01
02-26-2008, 05:36 AM
Just niceties I guess. Thank you for the help though

Apostropartheid
02-26-2008, 05:25 PM
Taking away control from the user isn't nice. It's mean. They won't give you cookies after, either.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum