-
AuthorPosts
-
January 30, 2018 at 11:12 am #904721
Hello, I like the Screen Options feature. I want to add a video on all mobile devices (landscape and portrait). I enabled:
x Hide on large screens (wider than 990px – eg: Desktop)
Landscape ipad is not showing the video. Portrait does. How can I fix this?January 31, 2018 at 6:13 am #905370Hey royaltask,
Thank you for using Enfold.
What is the version of your iPad? Please provide a link to the page so that we can inspect it.
Best regards,
IsmaelMarch 27, 2018 at 9:13 am #933477Same here!
Is there a possibility to change the 990px above? Newer iPad’s have a resolution of 2048 wide.
In portait mode no problem but landscape goes wrongMarch 28, 2018 at 6:04 am #934008Hi hgeurtse,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaMarch 28, 2018 at 8:48 am #934043Morning Victoria!
The link to my ‘issue’: https://www.hetcoachcafe.nl/in-de-praktijk/
I’ve placed two easy sliders, one containing a backgroundvideo (only visibile on large screens (wider than 990px – eg: Desktop) and a second one that’s hidden on large screens.
Problem with newer iPad’s is that Enfold recognizes it as large screen. Is there a way to make an addition to the quick CSS to hide the background video on iPad4?Thanks!
March 28, 2018 at 9:00 am #934044i would in this case not take the media-query via screenwidth only.
if you like to handle this only via css than there will be some queries for devices: Linkbut i think via functions.php and jquery it would be more selective.
for example this to functions.php of your child-theme:
Can you have a look if it is influenced your ipad too?Too embarrassing : sorry
- This reply was modified 6 years, 7 months ago by Guenni007.
March 28, 2018 at 9:11 am #934047@guenni Thanks for the input. But will all sliders be not visible then? Because I’m using 1 on desktop (with the video) and if the site is opened on a smaller screen another slider will be visible with only images
March 28, 2018 at 9:16 am #934050yes – but you can set a custom class or take the page id into selector.
Too embarrassing : sorryMarch 28, 2018 at 9:23 am #934051March 28, 2018 at 9:29 am #934057I’ve added the first piece of script to functions.php. Which custom class do I have to set so I can add it specific to this video-slider?
On my iPad all the sliders on all pages (hetcoachcafe.nl) are not visible
March 28, 2018 at 9:40 am #934064oh wow – i got a black out – that could not work – sorry
i first have to go and drink some coffeeyour intention is to show the image slider on ipad air even on landscape mode – and not the video.
now it shows the video on landscape !can you try this first – if it does not work the way you like:
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) and (-webkit-min-device-pixel-ratio: 2) { .page-id-40 #full_slider_1.wp_is_mobile {display: none}; .page-id-40 #full_slider_2.av-desktop-hide {display: block}; }
to prove it you have to empty the safari cacheor give this a try – but i don’t know how enfold manages it :
there are two classes set
.av-desktop-hide to your slider 2
.wp_is_mobile to your slider 1so the condition to find for your ipad is the one thing – but the other will be to be more selective than enfold setting
add_action('wp_footer', 'settings_for_ipad'); function settings_for_ipad(){ ?> <script type="text/javascript"> (function($) { $(document).ready(function($){ var deviceAgent = navigator.userAgent.toLowerCase(); if (deviceAgent.match(/(iphone|ipod|ipad)/)) { $('.page-id-40 #full_slider_1.wp_is_mobile').css( 'display' , 'none' ); $('.page-id-40 #full_slider_2.av-desktop-hide').css( 'display' , 'block' ); } }); })(jQuery); </script> <?php }
- This reply was modified 6 years, 7 months ago by Guenni007.
March 28, 2018 at 9:58 am #934075Thanks in advance!
March 28, 2018 at 10:02 am #934076:-( imagesliders on all pages work fine on iPad in landscapemode except for the page with the video-slider… Same behavior as the standard ‘screen options’ tab in the ALB
March 28, 2018 at 10:16 am #934084i edited the code above try those
March 28, 2018 at 10:25 am #934089Thanks Guenni. To bad but it doesn’t work :-(
March 28, 2018 at 10:43 am #934107the #top has to be in it: to be more selective
add_action('wp_footer', 'settings_for_ipad'); function settings_for_ipad(){ ?> <script type="text/javascript"> (function($) { $(document).ready(function($){ var deviceAgent = navigator.userAgent.toLowerCase(); if (deviceAgent.match(/(iphone|ipod|ipad)/)) { $('#top.page-id-40 #full_slider_1').css( 'display' , 'none' ); $('#top.page-id-40 #full_slider_2').css( 'display' , 'block' ); } }); })(jQuery); </script> <?php }
see my testpage https://webers-testseite.de/videos/
March 28, 2018 at 10:53 am #934111This works!!! And what do I have to add to this code If I want te show the video and the title above on iPad? If you rotate to portrait-mode the video and title appear below the text.
March 28, 2018 at 10:53 am #934112Excuse my initial confusion, but you always have to see how it’s originally set in Enfold to overwrite it.
a separate own test page helps always better than anything elsei see on your page that it works now ( on my ipad it does show now the slideshow (not the film) even on landscape version)
March 28, 2018 at 10:58 am #934115on my ipad you page id 40 ( in de parktijk ) shows now correct.
what do you mean by that : I want te show the video and the title above on iPad
can you make a visualisation on how it should look likeMarch 28, 2018 at 11:02 am #934117If you rotate your iPad to portait-mode the video and titel appear ;-)
My intentional idea was (because of the screen option in ALB):
on desktop show video-slider, hide image-slider, hide video (and titel) below text
on mobile show image-slider, show video (and title) below text and hide video-slider.But only on ipad landscape this doesn’t work. In this mode the website behaves like it’s shown on an desktop.
March 28, 2018 at 11:11 am #934120March 28, 2018 at 11:12 am #934121And when you scroll down in portrait-mode you will see the video and title
March 28, 2018 at 11:31 am #934139you didn’t mention that above.
try this please instead:
add_action('wp_footer', 'settings_for_ipad'); function settings_for_ipad(){ ?> <script type="text/javascript"> (function($) { $(document).ready(function($){ var deviceAgent = navigator.userAgent.toLowerCase(); if (deviceAgent.match(/(iphone|ipod|ipad)/)) { $('#top.page-id-40 #full_slider_1').css( 'display' , 'none' ); $('#top.page-id-40 #full_slider_2').css( 'display' , 'block' ); $('#top.page-id-40 #av_section_1 .av_textblock_section.av-desktop-hide').css( 'display' , 'none' ); $('#top.page-id-40 #av_section_1 .avia-video.av-desktop-hide').css( 'display' , 'none' ); } }); })(jQuery); </script> <?php }
March 28, 2018 at 11:37 am #934146It works fine now! Thank you very much!
March 28, 2018 at 11:47 am #934160Hi hgeurtse,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
VictoriaMarch 28, 2018 at 11:48 am #934161Thanks
March 28, 2018 at 11:49 am #934163:lol Enfold is great : on avia-compat.js there are some checks concerning to devices. (test(navigator.userAgent))
as i did above with that code
var avia_is_mobile = false; if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement) { avia_is_mobile = true; document.documentElement.className += ' avia_mobile '; }
so if it is a mobile the html document get the class avia_mobile
so we could use that allready for changings:
delete the function in your functions.php and try – this must be the same effect because avia-compat.js allready checked it an set that class to html:.avia_mobile #top.page-id-40 #full_slider_1, .avia_mobile #top.page-id-40 #av_section_1 .av_textblock_section.av-desktop-hide, .avia_mobile #top.page-id-40 #av_section_1 .avia-video.av-desktop-hide { display: none !important } .avia_mobile #top.page-id-40 #full_slider_2 { display: block !important }
March 28, 2018 at 12:02 pm #934177Made a little adjustment to that:
.avia_mobile #top.page-id-40 #full_slider_1 {
display: none !important
}
.avia_mobile #top.page-id-40 #av_section_1 .av_textblock_section.av-desktop-hide,
.avia_mobile #top.page-id-40 #av_section_1 .avia-video.av-desktop-hide,
.avia_mobile #top.page-id-40 #full_slider_2 {
display: block !important
}March 28, 2018 at 12:06 pm #934182because now you want to show the video on the bottom on ipad ?
on desktop i can go to developer tools and see all classes set.
But on ipad i did not have that ( simulators on web did not show this either)
so i had to search in enfold folder to recognize that on html the class is set – good to know for me too.March 28, 2018 at 12:07 pm #934183Yep! This is exactly what I wanted to show. thanks again.
-
AuthorPosts
- You must be logged in to reply to this topic.