Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
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