Last active
January 17, 2019 08:20
-
-
Save carlosonweb/5048e78af84d4acd8fcb0ed64d9d95d3 to your computer and use it in GitHub Desktop.
Randomize Display of Beaver Builder Content Slider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
var $slider = $('#bbcw-content-slider .fl-content-slider-wrapper').data('bxSlider'), | |
slideCount = $slider.getSlideCount(); | |
$slider.goToSlide( Math.floor( Math.random() * slideCount ) ); | |
}); |
Hi @mortensvendsen,
Sorry, I only noticed your message now. The above code has to be placed on the page where the Content Slider is embedded. You may go to Tools > Layout CSS and JavaScript > JavaScript and embed it in that box.
A better solution, I guess, is to override the Content Slider module in the child theme directory. Here's the code to tweak:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi carlosonweb,
I just have a question regarding your code piece. Where do I put the code on the website?