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 9 of 9

Thread: Cover Up

  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    187
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Cover Up

    I want a div with a black background to cover the whole window and any content that may be in that area, how would i do that? The idea is that i can then write some java scrip to show and hide this div. Thanks Phill

  • #2
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Code:
    <style type="text/css">
    * { margin: 0; padding: 0; }
    #hide { width: 100%; height: 100%; background-color: #000; }
    </style>
    
    <div id="hide">&nbsp;</div>
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,274
    Thanks
    28
    Thanked 271 Times in 265 Posts
    Code:
    div { position: absolute; /* or fixed */ width: 100%; height: 100%; }
    If you want to be able to use padding and borders on the outer div element, you need to use offsets. Offsets are not properly supported by Internet Explorer 6.

    Code:
    div { position: absolute; /* or fixed */ top: 0; left: 0; right: 0; bottom: 0; }
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #4
    Regular Coder
    Join Date
    Mar 2006
    Posts
    187
    Thanks
    5
    Thanked 0 Times in 0 Posts
    that works, to fill the window that is, but if you scroll, you can see part of the page at the bottom.

  • #5
    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
    Can you tell us exactly what it is that you are trying to do?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    Regular Coder
    Join Date
    Mar 2006
    Posts
    187
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Can you tell us exactly what it is that you are trying to do?
    something similar to light box, for an example see http://www.avon-tyres.co.uk/motorcyc...=showtyre&id=6

    click one of the wheels

  • #7
    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
    Okay then why not use lightbox or thickbox?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    Regular Coder
    Join Date
    Mar 2006
    Posts
    187
    Thanks
    5
    Thanked 0 Times in 0 Posts
    because thats too easy :-) . I like learning new techneques and i find the best way is to emulate something. I know i may be trying to re-invent the wheel, but thats the way i like it.

  • #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
    Its just as easy as going to a forum and asking how to accomplish something similar. I don't see the point. To recreate something like lightbox you would need to have a strong knowledge of javascript prototype as well as scriptaculous. for a beginner like yourself it can be cumbersome.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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