css3 - Tricky CSS scroll length -


<div class="container1"></div> <div class="container2"><div class="container2-inner"></div></div>  .container1 { height: 5000px; } .container2 { height: 100%; width: 100%; position:absolute; } .container2-inner { height: 1000px; margin: 0 auto; } 

.container2-inner height varies depending on content inside (.container2 overlay popup window).

currently vertical browser scroll 5000px no matter or more if .container2-inner exceeds 5000px. i'd scroll 1000px when popup window active still want keep 5000px high .container1 below. how achieve that?

not sure understand problem either based on description maybe like...

css

html, body {padding:0;margin:0;} .container1 {height:5000px;background:red;} .container2 {height:100%;width:100%;position:absolute;top:0;left:0;background:green} .container2-inner {height:1000px;width:400px;overflow-x:hidden;overflow-y:scroll; margin:0 auto;background:yellow} 

html

<div class="container1"></div> <div class="container2">     <div class="container2-inner">     start here<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     ...<br />...<br />...<br />...<br />...<br />...<br />     end here     </div> </div> 

you can see results @ http://dabblet.com/gist/2876726


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -