iPad landscape and portrait orientation differ?
-
This plugin generally works great, and thank you for making it!
On my client’s site, https://www.FocusCFO.com, there is an image link to a YouTube video. On desktop, it uses a lightbox plugin, but on mobile it would not work so I added the is_mobile code using your plugin that would make the mobile view simply a clickable link to YouTube. This worked perfectly on my Android as well as on her iPhone and iPad–but on the iPad, it showed up only in landscape mode and not portrait.
So I added iPad-specific code (below) but now on the iPad she sees both the desktop lightbox version and the iPad change—but only in landscape. In portrait view, she’s fine.
Should I have to mark the desktop original with some sort of “desktop” code? Or is there a way to add the orientation to your code? I know it has something to do with the sizing…should I make the image 600px max width?
Here’s my code (part of the header), and many, many thanks for any help:
<div id="slider"> <p align="center"> <a href="https://www.youtube.com/watch?v=tmz1jwED35Q&rel=0" rel="wp_lightbox_prettyPhoto" title=""> <img src="https://focuscfo.com/wp-content/uploads/2015/11/listenUp2.jpg" alt="YouTube" /> </a> </p> </div> <?php if ( is_mobile() ) { echo '<div> <p style="text-align:center;"><a href="https://www.youtube.com/watch?v=tmz1jwED35Q&rel=0"> <img src="https://focuscfo.com/wp-content/uploads/2015/11/listenUp2.jpg" style="max-width:400px"> </a></p> </div> <div>'; } ?> <?php if ( is_ipad() ) { echo '<div> <p style="text-align:center;"><a href="https://www.youtube.com/watch?v=tmz1jwED35Q&rel=0"> <img src="https://focuscfo.com/wp-content/uploads/2015/11/listenUp2.jpg" style="max-width:400px"> </a></p> </div> <div>'; } ?>
- The topic ‘iPad landscape and portrait orientation differ?’ is closed to new replies.