Helpful code snippets
-
As Easing Slider contains many JS and PHP functions that users can hook into when creating their own additional functionality, I’ve decided to make a topic where users can share their code snippets.
Here are two I find users asking for quite often. Add these to your theme’s header.php file before the </head>. You can also add these to your own Javascript files, or even into your footer.php file before the </body>.
Pause slideshow on hover
<script type="text/javascript"> jQuery(document).ready(function($) { $('.easingsliderlite').on('mouseenter', function() { $('.easingsliderlite').data('easingsliderlite').pausePlayback(); }); $('.easingsliderlite').on('mouseleave', function() { $('.easingsliderlite').data('easingsliderlite').resumePlayback(); }); }); </script>
End automatic playback after all slides have been shown
<script type="text/javascript"> jQuery(document).ready(function($) { var inc = 0; $('.easingsliderlite').data('easingsliderlite').$el.on('nextslide', function() { inc++; if (inc == $('.easingsliderlite').data('easingsliderlite').count) { $('.easingsliderlite').data('easingsliderlite').endPlayback(); } }); }); </script>
Feel free to share your own ??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Helpful code snippets’ is closed to new replies.