Prevent orientation change in touch devices with javascript - javascript

I am developing a mobile web app. Is it possible to prevent orientation change? I want only portrait view. I was looking for some JavaScript solution, but could not find one. I am just using jQuery (no jQuery mobile). Thanks in advance.

Related

Lock orientation for mobile devices

How would I lock the orientation for a mobile device using js, phaser or jquery? Is there a generic way to do it so it locks orientation regardless of the platform or device used?
I basically want to lock landscape mode for my browser based game.
There is a forceOrientation and a forcePortrait method in the ScaleManager class. See docs.
We also usually use an image to ask the users to flip their phones.
As well, you can listen to the incorrectOrientation signal so know when the game is in the undesired orientation.
I hope it helps :)
You can also do it using Intel XDK
intel.xdk.device.setRotateOrientation("landscape");
intel.xdk.device.setAutoRotate(false);

Smooth scrolling on windows Phone 7 mobile site

I am creating a mobile webapp for windows phone 7.5 devices and would like a box with overflow:scroll to scroll smoothly (not stop when you release the content on scrolling with your finger).
Now for iOS this exists: -webkit-overflow-scrolling:touch;
Is there any similar thing for WP7? I tried overflow-scrolling:touch; and -ms-overflow-scrolling:touch; but those do not work.
Is there an online resource for WP7.5 web development?
Any javascript alternative?
Thanks for your help!
I believe the only way to do it is using a JavaScript Scrolling to replace the default auto scroll.
Take a look at iScroll or something similar

how to enable/add scrollbar in android phonegap?

I created dynamic list using android phonegap application.Now I want to add scrollbar for that list. I used html and javascript/jquery for creating dynamic list in android phonegap application.how to add scrollbar dynamically to that list?
Is it possible add scrollbar in android phonegap application?
please guide me
Thanks in advance
Mobile WebKit (iOS and Android, etc) does not provide a native way to scroll content inside a fixed width/height element, but many libraries can help you with that issue.
I use the iScroll to scroll the content in my PhoneGap app. It's a very lightweight framework, only focuses on the scroll problem of mobile WebKit browser or WebViews, and it works perfect.
Here is a simple example.

jQuery slider for iPad and iPhone?

I am developing a video player using html5 for iPad and iPhone device, I implemented a scrub bar for video seeking. It works fine in the normal screen, if the page is zoomed then it behaves in a different way, I need a external resource for this. Is there is any plugin for it or any other idea for it?
How about preventing the zoom? If you design your page for a iPhone/iPad, just make it fit the screen and unzoomable.

iOS Linen background CSS?

Is it possible to customize the linen background shown when you scroll past the end/top of the page in mobile safari via CSS/Javascript?
I know it can be done via Obj C, but Im not developing an application, Im developing a website in native mobile safari for the web.
Is it possible? If so how?
There is no way to customize this background.
The only workaround I can think of is to disable scrolling by preventDefault()-ing the various touch events on window and implement your own scrolling.

Categories

Resources