jquery - How to place a div in a way the user always needs to scroll to see it? -
i want build website div on top, 100% in "height" (regardless of users screen size or size of browser window), every other content on site, "hidden" , user needs scroll down watch it.
problem: every time use 100% in div height, , float div beneath first one, second div moves far bottom of site. don't find way use height:100% in way.
problem: want place content in first div center center. in example, , combine above described example.
i hope description clear enough, welcome.
regards.
use jquery finding resolution , set in element's width , height:
html:
<div id='test'></div>
jquery script:
$(document).ready(function(){ var w = $(window).width(); var h = $(window).height(); $('#test').css({width: w, height: h, background: '#bbb', position: 'absolute', top: "0", left: 0}); });
Comments
Post a Comment