Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(window).bind('orientationchange', function (event) {
- if (event.orientation == "landscape") {
- set frame for landscape
- } else {
- set frame for portrait
- }
- });
- $(window).bind('orientationchange', function(event) {
- alert('new orientation:' + event.orientation);
- });
- $(window).on('load orientationchange', function(event) {
- if(event.orientation == "landscape")
- {
- set frame for landscape
- }
- else
- {
- set frame for portrait
- }
- });
- var isiPad = navigator.userAgent.indexOf('iPad') != -1
- //or
- var ua = navigator.userAgent;
- var isiPad = /iPad/i.test(ua)
- if (isiPad) {
- $(window).on('load orientationchange', function(event) {
- if(window.innerHeight > window.innerWidth){
- console.log("portrait");
- } else {
- console.log("landscape");
- }
- });
- }
Add Comment
Please, Sign In to add comment