samedi 9 juillet 2016

Is there a simple way to do two jQuery effects right after each other?


Basically, I have a div that I want to apply a highlight and bounce effect to. If I do just one, it works fine. But combining them seems to be much more tricky than I expected. I tried to do simply this: $('.highlight_on_success').bind("ajax:success", function(){$(this).closest('div.social-comment').effect('highlight').effect('bounce');}); But that didn't work, then I did some reading and I tried using dequeue() like so: $('.highlight_on_success').bind("ajax:success", function(){$(this).closest('div.social-comment').effect('highlight').dequeue().effect('bounce');}); But that too didn't work. I eventually stumbled across this answer on SO about something similar, but that feels WAAAAAYYY too heavy. Is there a simpler, more native, less hacky, way to achieve what I am trying to do?

Aucun commentaire:

Enregistrer un commentaire