Tagged: x
-
AuthorPosts
-
September 21, 2016 at 1:50 pm #1185201
EveVaterlausParticipantHow can I make parallax elements scroll at different speeds?
The js is not doing it for me.
Thanks
EveSeptember 21, 2016 at 2:02 pm #1185227
RahulModeratorHi there,
Thanks for writing in!
To change the speed, you can simply use following jQuery code under Custom > JavaScript in the Customizer:
jQuery(document).ready(function() {
//
// Attach parallax handlers.
//if (Modernizr.touch) {
jQuery(‘.x-content-band.bg-image.parallax, .x-content-band.bg-pattern.parallax’).css(‘background-attachment’, ‘scroll’);
} else {
jQuery(‘.x-content-band.bg-image.parallax’).each(function() {
var id = jQuery(this).attr(‘id’);
jQuery(‘#’ + id + “.parallax”).parallaxContentBand(‘50%’, 0.3);
});
jQuery(‘.x-content-band.bg-pattern.parallax’).each(function() {
var id = jQuery(this).attr(‘id’);
jQuery(‘#’ + id + “.parallax”).parallaxContentBand(‘50%’, 0.5);
});
}});
By changing 0.3 and 0.5 to your desired speed from 0 to 0.9 (default speed is 0.1 and 0.3).
Hope this helps. 🙂 For more reference have a look at https://community.theme.co/forums/topic/parallax-background-speed/
Thank you.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1185201 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
