javascript - How detect actual position before start change screen orientation? -


i'm trying detect actual position of page scrool before start change orientation.

it determine position of "new" screen (in new orientation) show.

i tried check, every scroll event, actual position, can see below:

$(window).scroll(function() {             var scrolltop = $(window).scrolltop();      if (scrolltop >= window.secao1 && scrolltop <= window.secao1){         window.secaoidset = "s1";     }      if (scrolltop >= window.secao2 && scrolltop <= window.secao2){         window.secaoidset = "s2";     }      if (scrolltop >= window.secao3 && scrolltop <= window.secao3){         window.secaoidset = "s3";     }      if (scrolltop >= window.secao4 && scrolltop <= window.secao4){         window.secaoidset = "s4";     }      if (scrolltop >= window.secao5-2){         window.secaoidset = "s5";     }        }); 

and set position show in new orientation, don't know when action:

$(window).scrolltop($('#' + window.secaoidset).offset().top + 'px'); 

first create handler

$(window).on("mousewheel", function() {     alert($(document).scrolltop()); } 

then call

$(window).mousewheel(); 

hope help.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -