Combine hover and click functions (jQuery) ?

Posted by Nimbuz on Stack Overflow See other posts from Stack Overflow or by Nimbuz
Published on 2010-03-12T10:30:31Z Indexed on 2010/03/12 10:37 UTC
Read the original article Hit count: 197

Filed under:
|
|
|
|

Can hover and click functions be combined into one, so for example:

click:

$('#target').click(function() {
  // common operation
});

hover:

$('#target').hover(function () {
    // common operation
});

can they be combined into one function?

Thanks!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery