samedi 27 avril 2019

jQuery - hover and if statement

I'm trying to run hover but only if a given element has certain class.

For exaple:

jQuery

$("#banner").hover(
  if ($(this).hasClass("bannerReady")) {
  function() {
    runOne();
  },
    function() {
      runTwo();
    }
}
);

But this won't work.

Aucun commentaire:

Enregistrer un commentaire