Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Creating Horizontal Sliding Effect for Multiple Divs Reply To: Creating Horizontal Sliding Effect for Multiple Divs

#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() { .. });