-
AuthorPosts
-
July 18, 2018 at 6:26 am #986778
Hi,
I’m very happy with your horizontal gallery, but is there any way, I can get the images to autoslide?I know, I can use a slider for this, but I cannot figure out how to make the slider look like the horizontal gallery, which is the look, I prefer for this site.
Thank you for your help!
July 18, 2018 at 8:34 am #986834Hey Malene,
Thank you for using Enfold.
You can use this script in the functions.php file to set an autorotation to the horizontal gallery element. Set the interval in ms. Default is 2 seconds.
function ava_horizontal_gallery_interval() { ?> <script> (function($) { // set the autorotation duration in ms var interval = 2000; $('.av-horizontal-gallery').each(function() { var i = 0; var b = 0; var slider = $(this).find('.av-horizontal-gallery-slider'); var item = slider.find('.av-horizontal-gallery-wrap'); var next = $(this).find('.next-slide'); var prev = $(this).find('.prev-slide'); var count = item.length; var nextSlide = () => { setInterval( $.proxy(function() { next.trigger('click'); i++; if(i == count && item.last().is('.av-active-gal-item')) { clearInterval(nextSlide); $(this).trigger('av-reset-item'); i = 0; } }, this), interval); } nextSlide(); $(this).on('av-reset-item', function() { setTimeout( function() { var resetSlide = setInterval( $.proxy(function() { prev.trigger('click'); if(count == b && item.first().is('.av-active-gal-item')) { clearInterval(resetSlide); b = 0; $(this).trigger('av-next-item'); } b++; }, this), 10); }, interval); }); $(this).on('av-next-item', function() { nextSlide(); }); }); })(jQuery); </script> <?php } add_action( 'wp_footer', 'ava_horizontal_gallery_interval', 9999 );
Best regards,
IsmaelJuly 18, 2018 at 1:55 pm #986973Just what I needed!
Thank you – you’re the best!
/MJuly 19, 2018 at 5:39 am #987266Hi,
Great, glad we could help :-)
Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardJuly 19, 2018 at 1:13 pm #987377Hi again:
One more question: Is it possible to show the caption and/or image title on the images in the slider? For now, I can only see them, if i click on one of the images and I’d like it to show on alle the pictures all of the time (like in a regular slider)..
Best
M.July 23, 2018 at 5:34 am #988587Hi,
That is possible but it requires you to modify the core theme files. You have to edit it on every update. Please use the theme’s slider instead.
Best regards,
IsmaelJuly 8, 2021 at 10:08 am #1309223Thanks, Ismael
What do we need to add to this code to make it Page-Specific rather than be across the complete website?July 8, 2021 at 10:13 am #1309225When I click Update File in functions.php I get “nonce_failure”
July 8, 2021 at 10:15 am #1309226Fixed itself don’t know why???
Working and saving OK :)
Thanks for your helpJuly 11, 2021 at 10:22 pm #1309618Hi,
Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold
Best regards,
Mike -
AuthorPosts
- The topic ‘Can the horizontal gallery autoslide the images?’ is closed to new replies.