-
AuthorPosts
-
February 5, 2018 at 8:41 pm #908182
Hi,
I need to set the homepage of a website I’m making so that it has a color section with a fixed background but if I check with a responsive tester website everything is okay: the problem is that on my iPhone 5S it doesn’t work.
I managed to fix the scrolling part with this CSS:.avia_mobile #top .av-parallax {
position: fixed;
background-position: center top;
}But this way it still acts weird and the image size is screwed.
What can I do?
February 6, 2018 at 7:16 am #908376Hey Webamorfosi,
If you need greater control over the behaviour on mobile, then you could copy the Color Section and use an image better adapted to mobile screens in the new one. You can hide/show the correct one using the Screen Options settings in the element settings.
Best regards,
RikardFebruary 6, 2018 at 7:07 pm #908723I tried changing the image, but the sliding action is glitchy: when you scroll down on iPhone, the images doesn’t scroll smoothly and the background changes position without reason just by sliding. Is there a way to make it behave correctly? Also, to see what I’m talking about you have to check on iPhone (not on websites that simulate responsive).
Best part about it is that I just checked on an Android phone and the background is not even fixed.Is there a way to solve this and actually have a fixed background on mobile too?
February 7, 2018 at 10:18 am #908990Hi Webamorfosi,
Fixed backgrounds do not work on iPad and iPhone, you need to set the image to scroll.
Here is a thread about it
https://www.sitepoint.com/community/t/fixed-background-on-ipad/203905/3If you need further assistance please let us know.
Best regards,
VictoriaSeptember 4, 2018 at 3:56 pm #1005664hello victoria,
unfortunally the fixed background works on apple mobile.
you can see it here:
carinaherrmann.de
is it possible to do the same effect with enfold?
- This reply was modified 6 years, 2 months ago by volmering.
September 5, 2018 at 10:17 am #1005952Hi volmering,
It is possible with css and html and so is possible in Enfold, it is out of the scope of our support to be building this kind of functionality though.
Best regards,
VictoriaSeptember 6, 2018 at 2:23 pm #1006613hallo victoria,
thx for your answer.
but kriesi offered some demos for enfold, for example the “Visual Artist”-Demo. there is also a fixed background. but not working on I-pad, i-phone, samsung galaxy and so on. these demos are not in the scope of your support too? :-)
the problem is, meanwhile 50% of website visitors use mobile devices. also my customers.
for example:
a customer decide to use the “enfold visual artist demo”. i say ‘ok, no problem, but the fixed background does not work on mobile devices’. then he shows me several wp-themes with working fixed backgrounds. :-)solution could be, to mark the themes on the enfold-demo-overview-page with “not working on mobile” or remove them
temporarilydont get me wrong, in my opinion enfold and the enfold-support ist still the best choice!!!
but on mobile devices, other demos overtake slowly but sure
September 10, 2018 at 5:07 am #1007752Hi,
Thanks for the update.
A quick explanation why fixed elements are a bit erratic on mobile view.
// https://kriesi.at/support/topic/fullscreen-slider-fixed-position-doesnt-work-in-mobile/#post-997863
One of the users provided a fix that converts fixed to static backgrounds on mobile view.
// https://kriesi.at/support/topic/playing-with-new-demos/#post-871865
Best regards,
IsmaelSeptember 10, 2018 at 12:28 pm #1007872hey ismael, than k you for your quick answer.
i know both threads :-)
on this wordpress site:
carinaherrmann.dethey found a solution for it
unfortunally my skills are to bad to see on this site how i can “transfer” their css and html into the enfold-visual-artist-demo
- This reply was modified 6 years, 2 months ago by volmering.
September 11, 2018 at 4:12 am #1008154Hi,
They are actually not the same. They set the actual container, not the background image, as a “fixed” element and change its position to “relative” once the scroll position is equal or higher than the view port height on scroll. You can do the same with the theme if you want to accomplish the same effect. Add two color sections, set both height minimum height to 100% of the browser height, add the background image to the second color section and then apply a unique Section ID to it –e.g., “fixed-section”. After that, add this script in the functions.php file.
add_action('wp_footer', 'avia_scroll_fixed_section', 9999); function avia_scroll_fixed_section() { ?> <script> (function($) { $(document).ready(function () { var fixed = $('#fixed-section'); function avia_scroll_fixed_section() { set_status = function() { var st = $(window).scrollTop(); var h = $(window).height(); console.log(h, st); if(st >= h) { fixed.addClass('fixed-section-arrived'); } else { fixed.removeClass('fixed-section-arrived'); } }; $(window).on( 'scroll', function(){ window.requestAnimationFrame( set_status )} ); set_status(); } avia_scroll_fixed_section(); }); })(jQuery); </script> <?php }
And this css code on the Quick CSS field:
#fixed-section { left: 0; right: 0; bottom: 0; z-index: -1; width: 100%; position: fixed; height: 100vh; will-change: transform; } .fixed-section-arrived { position: static !important; }
Don’t forget to remove the browser prior to checking the page.
Best regards,
IsmaelSeptember 11, 2018 at 10:48 am #1008311hey ismael,
thank you very much!!!
ill try this and let u know.
September 11, 2018 at 12:56 pm #1008369Hi,
Thanks for the update, we’ll keep the thread open in case you should need any further help.
Best regards,
RikardOctober 29, 2018 at 6:33 pm #1027697hi ismael, hi rikard,
thx for your patience.
i decide to start all over with the enfold visual artist demo.
on my own website (data see below) i want to find a solution for the fixed background issue in the visual artist demo.
this demo works like a charm on desktop and the tablet-emulator in chrome. but on real tablets and smartphones unfortunally not.
the issues are the fixed backgrounds, the background-positions and background sizes.
i tried everything. own classes for my color-sections, i read all threads in the forum about the issues. tried every work-around i found. without success.
my question to ismael is now:
is it possible to fix the visual artist demo with your php snippet you posted above? or is there any other solution?thx for your assistance in advance!
October 30, 2018 at 11:48 pm #1028284Hi,
Fixed background are disabled on mobile devices by default. You may need to do this modification…
// https://kriesi.at/support/topic/playing-with-new-demos/#post-871865
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.