arscan / pleaserotate.js Goto Github PK
View Code? Open in Web Editor NEWπ Politely ask your users to view your mobile website in portrait or landscape mode
Home Page: https://www.robscanlon.com/pleaserotate/
License: MIT License
π Politely ask your users to view your mobile website in portrait or landscape mode
Home Page: https://www.robscanlon.com/pleaserotate/
License: MIT License
A simple and good idea is the script. Unfortunately, it only works for pages that are called directly in the browser (Safari). If you use the web app functions in iOS and place a link on the homescreen it doesn't work. Example: http://Piepmatz.einzelfabrik.de/index4.php
In my case I only want to allow portrait mode - and forbid landscape.
What can I change?
It's staying in English.
I am using your framework for an project.
My issue:
On my iPhone iOs 11 Firefox and Chrome, the event only triggers once. after i change to landscape mode and portrait mode again it wont work and doesnt show the "please change to langscape mode" alert. On Safari it works.
Just a terribly handy solution to an annoying problem without overcomplicating it all.
I wanted to say thanks.
Hi,
Is there a way to not show the pleaserotate when the viewport or width is greater than certain pixel? For example, set a maximum width where pleaserotate would be activated but not if it's it's bigger... In other words, I want to enable this for portrait on mobile devices (smaller screen) but not necessarily for tablets or bigger mobile phone (e.g. iPhone 8 Plus) since they already have wide enough screen even on portrait.
Thank you.
Does someone know how to use iconNode? Tried a different thing and nothing seem to work.
I'm using pleaseRotate with VueJS on one of my apps.
I call pleaseRotate.start() when I'm mounting [mount()] my app.
calling pleaseRotate.stop() doesn't kill existing pleaseRotate items, so if I'm going
[app] -> [back] -> [app]
pleaseRotate.start() is called twice, while pleaseRotate.stop() is called once [on beforeDestroy()]
and pleaseRotate is activated on both portrait and landscape mode [while the flag forcePortrait is at it's default setting of true].
My workaround is to put createElements() inside the if statement:
if (!document.getElementById('pleaserotate-backdrop'))
[which checks if there is already pleaseRotate div elements existing]
please contact me with any questions regarding this issue and reproducing it.
Hi,
It's possible but only on tablet ? (Where specify dimensions ?)
Because I don't want this on mobile but only in tablet.
Thank you so much
Great script! Elegant way to tell users the site is optimized for a particular orientation. Got it working with Wordpress.
For my needs, I'm using forcePortrait: true,. When the device is rotated to landscape, the graphic rotation is upside down (home button of the device graphic is on the top). If willing, can you share how to start the graphic in the portrait position and translate to landscape?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.