08.06.2016, 06:47
(07.06.2016, 14:27)Erwin van der Zwart Wrote: Hi Buuuudzik,
Try this:
Code:$(function(){
function doOnOrientationChange(){
switch(window.orientation)
{
case -90:
case 90:
//alert('landscape');
showPlan(101);
break;
default:
//alert('portrait');
showPlan(1);
break;
}
}
window.addEventListener('orientationchange', doOnOrientationChange);
// Initial execution if needed
doOnOrientationChange();
});
BR,
Erwin van der Zwart
Thanks for your help but sory, I described this in a wrong way. The script should change actual page(vertical) to another(horizontal) when the orientation changed. This must be based on variables because this should change e.g. for page 1 -> page 101, page 2 -> page 102 etc... Or can be based on page names e.g. Home_V_1 -> Home_H_1, Home_V_2 -> Home_H_2, etc...