OK So I need to detect if someone is using mobile and then politely ask them to rotate the screen so that it is a landscape window, not a vertical one.
I found this answer for detecting a mobile browser.
Using Bootstrap, I would like to make a modal appear for to tell them to rotate the screen.
I also found this from the Bootstrap JavaScript guides:
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
As you can see they use data-toggle="modal" data-target="#myModal"
to call forth the modal. How would I go about implementing that so it runs when a Javascript value is returned?
Something like
if ( mobile == 1 ) {
// open modal
else {
// ignore modal (do nothing)
}
would suffice for the detection, but how would I go about the //open modal
part?
jQuery can be used as well, if that helps anyone (removes some restrictions).
Thanks!