Randomized starting image
-
As shown below, I have added one line of code (delimited with // WRM) to your script in wp-vertical-images-thumbnail-slider.php to randomize the starting image. You can see the result in the starting order of the advertiser tiles in the sidebar at https://www.sttammanyfarmer.net/ (just refresh your browser to see the randomization in action).
I would love to see you add this as an option in the slider settings so users could choose whether to employ it.
Thanks for giving this some consideration.
<script type="text/javascript"> var $n = jQuery.noConflict(); $n(document).ready(function() { $n(".verticalmainSliderDiv").jCarouselLite({ btnNext: ".next_vertical", btnPrev: ".prev_vertical", <?php if($settings['auto']){?> auto: <?php echo $settings['speed']; ?>, <?php } ?> speed: <?php echo $settings['speed']; ?>, <?php if($settings['pauseonmouseover'] and $settings['auto']){ ?> hoverPause: true, <?php }else{ if($settings['auto']){?> hoverPause: false, <?php }} ?> circular: <?php echo ($settings['circular'])? 'true':'false' ?>, <?php if($settings['visible']!=""){ ?> visible: <?php echo $settings['visible'].','; ?> <?php } ?> scroll: <?php echo $settings['scroll']; ?>, // WRM begin start: Math.floor(Math.random()*(<?php echo $settings['visible']; ?>+1)), // WRM end vertical:'true' }); $n("#verticalmainscollertd").css("visibility","visible") }); </script>
- The topic ‘Randomized starting image’ is closed to new replies.