Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
You should use once for slider.js, otherwise it will fired every behaviours attach running. Like next:
Drupal.behaviors.slider = {
attach: function (context, settings) {
// Next just sample, use correct #element
$('#slide').once('slider', function() {
// your code...
});
});
This problem came if you will use colorbox and your slider in the same page. Then clicking colorbox popup links, after sometime slider will rotate faster and faster...
Useful info about once: https://www.drupal.org/node/756722#jquery-once
Comments