Why can't I hang the handler on the jcarousel carousel control keys?

 $('.jcarousel-next').click(function(){ alert('Hello'); }); 
  • one
    Depending on how you hang, if prior to the initialization of the script (which is most likely), it simply does not exist at that time, so the subscription does not go. Well, just to check before you hang .click .click, .click $('.jcarousel-next') to the console - Vasily Barbashev
  • oo, just thank you)) - Slavik Mojito
  • @ Vasily Barbashev publish the answer) - Nick Volynkin

1 answer 1

Apparently you are trying to hang an event on an object that is not yet in the dom model, so the subscription does not go. Well, to check just before you hang .click .click .click $('.jcarousel-next') to the console

  • Everything earned thanks, you had to write this script after slider initialization ... - Slavik Mojito
  • Mark the question as resolved - Vasily Barbashev