Home › Forums › CSS › Creating Horizontal Sliding Effect for Multiple Divs › Reply To: Creating Horizontal Sliding Effect for Multiple Divs
January 6, 2017 at 1:20 pm
#249780
Shikkediel
Participant
If you bind the event to #next
and then change the id
to another element, the handler will still be cached for the original element. To make this “dynamic” (so that it will always pick the current element with the id
), you can use a delegated event handler:
$('.container').on('click', '#next', function() { .. });