...

View Full Version : Cover Up



phill_ridout
07-21-2007, 02:52 PM
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

BWiz
07-21-2007, 04:43 PM
<style type="text/css">
* { margin: 0; padding: 0; }
#hide { width: 100%; height: 100%; background-color: #000; }
</style>

<div id="hide">&nbsp;</div>

Arbitrator
07-21-2007, 05:08 PM
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.


div { position: absolute; /* or fixed */ top: 0; left: 0; right: 0; bottom: 0; }

phill_ridout
07-21-2007, 10:37 PM
that works, to fill the window that is, but if you scroll, you can see part of the page at the bottom.

_Aerospace_Eng_
07-21-2007, 10:40 PM
Can you tell us exactly what it is that you are trying to do?

phill_ridout
07-21-2007, 10:45 PM
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/motorcycle/?page=tyres&method=showtyre&id=6

click one of the wheels

_Aerospace_Eng_
07-21-2007, 10:58 PM
Okay then why not use lightbox or thickbox?

phill_ridout
07-21-2007, 11:36 PM
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.

_Aerospace_Eng_
07-21-2007, 11:55 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum