My mobile design is different from desktop, so I need to change some structure for ipad portrait. Now with my code written below it effects both on portrait and landscape. I need a script which will do some actions only for ipad portrait and even when I change orientation in this case also code work only for portrait.
Here is my code:
function orient() {
if (window.orientation == 0 || window.orientation == 180) {
// some actions
}else if (window.orientation == 90 || window.orientation == -90) {
// some actions
}
}
$(function(){
orient();
});
$(window).bind( 'orientationchange', function(e){
orient();
});