Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. window.onorientationchange = detectIPadOrientation;
  2. function detectIPadOrientation () {
  3.  
  4. if ( orientation == 0 ) {
  5. jQuery('.home-banner').css('height', 'auto');
  6. alert ('Portrait Mode, Home Button bottom');
  7. }
  8. else if ( orientation == 90 ) {
  9. jQuery('.home-banner').css('height', jQuery(window).outerHeight());
  10. //alert ('Landscape Mode, Home Button right');
  11. }
  12. else if ( orientation == -90 ) {
  13. jQuery('.home-banner').css('height', jQuery(window).outerHeight());
  14. //alert ('Landscape Mode, Home Button left');
  15. }
  16. else if ( orientation == 180 ) {
  17. jQuery('.home-banner').css('height', 'auto');
  18. alert ('Portrait Mode, Home Button top');
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement