Riot Zeast Captain
Riot Zeast Captain

Reputation: 968

How to change mouse click to mouse hover?

Here is the jsfiddle link in which I got the code for the animated tooltips, but the problem is that on click only they are working, I want that to be animate when I hover the mouse on it.

Upvotes: 3

Views: 135

Answers (2)

Harish Kommuri
Harish Kommuri

Reputation: 2854

JSFiddle.

Use mouse events mouseenter and mouseleave.

$('.popover-example li a').mouseenter(function() {
   $(this).trigger("click");
}).mouseleave(function() {
   $(this).trigger("click");
})

Upvotes: 0

spencer.sm
spencer.sm

Reputation: 20526

Try adding this:

$('.popover-example a').hover(
  function(){
    $(this).click();
  }
);

https://jsfiddle.net/14Lz0f5z/

Upvotes: 3

Related Questions