starting a page to a div
- Started
- Last post
- 11 Responses
- rabbit0
yes
- GeorgesIV0
yo rabbit,
on what should I apply the relative position?
the page still start on top, not right at the div height
- uan0
body {
margin-top:-100px;
}- Where "100px" is replaced with the height of the div you want to hide.orrinward2
- yeah, the 100px is the "black" areamonospaced
- Stugoo0
You could also do
.main-div {
position: relative;
}.hidden-div {
position: absolute;
top: -100%; // or bottom:100%;
}
- GeorgesIV0
Never thought on using negative size number,
you guys rock, it worked,
but how do I make the hidden area appear now?
everyone gets a virtual high five :)
- fadein110
onclick/load or woteva - dom.movediv+100px ha.
above but coded correctly.
- bulletfactory0
you could use jquery toggle function. You will need something to be clickable to trigger the toggle, unless you want it time-based.
- ukit20
Why not just set the height of the hidden div to zero, and then animate it to the normal height when you want it to appear?
Seems cleaner than the negative margins stuff.
- GeorgesIV0
gonna use a jquery toggle function,
seems a lot simpler than all the things I was thinking of
- mekk0
just use js to scroll down the height of the div to hide on load
- mekk0
^ try this if you have jquery installed:
$(document).ready(function() {
$('html, body').animate({
scrollTop: $("#mainDiv").offset().top //your of the main div
}, 1000); //Time for this effect to take
});