my website's width 1200px, when lower resolution looking site horizontal scroll visible , scroll bar located left.
is there way locate scroll center using css, javascript or jquery?
the best way use $(window).scrollleft();
just place center value of window scrollleft function , page reposition itself. easiest way find center of page take 1200 width , divide 2, subtract calculated $(window).width();
divided 2.
var scrollpos = (1200/2) - ($(window).width()/2);
Comments
Post a Comment