Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15

Thread: Disable page.

  1. #1
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts

    Disable page.

    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.

  • #2
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    do you have an example page where you have seen this. It sounds like a jasvascript problem.

  • #3
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    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.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Kind of like thickbox? Check out the demos.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    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:

    Code:
    #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?
    Last edited by flynch01; 02-25-2008 at 11:24 PM.

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    That kindof, causes other problems. Ok no worries i'll javascript it.

  • #8
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    Sorry to keep replying but, how do I disable scrolling? I want to do it temporarily.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You can use javascript.
    Code:
    document['body'].style.overflow = 'hidden';
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    flynch01 (02-26-2008)

  • #10
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    Nice. All works nice now.

    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?
    Last edited by flynch01; 02-26-2008 at 01:09 AM.

  • #11
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #12
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    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.

  • #13
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #14
    Regular Coder
    Join Date
    Mar 2007
    Posts
    357
    Thanks
    46
    Thanked 22 Times in 21 Posts
    Just niceties I guess. Thank you for the help though

  • #15
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Taking away control from the user isn't nice. It's mean. They won't give you cookies after, either.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •