Mouse events (when passing an x element) Jquery

Asked

Viewed 354 times

0

Well, I’m having trouble with mouseenter(). it only fires the event if I click, I need that when passing inside an element(div) it fires the event.

Like I’m doing:

                        $('#<?php echo $x?>').mouseenter(function(){
                            $('#<?php echo $x?>').popover('show');
                        });

When I click shoots, the more I actually need it to shoot while passing the mouse.

2 answers

1


The ideal is that you use the method mouseover in fact, in this case there in your PHP would be as follows:

$('#<?php echo $x?>').mouseover(function(){
    $('#<?php echo $x?>').popover('show');
});

To make sure that the event is being pegged correctly you can enter an alert in the item so that a message is fired on the screen:

$('#<?php echo $x?>').mouseover(function(){
    $('#<?php echo $x?>').popover('show');
    alert("Mouse sobre o elemento: <?php echo $x?>"));
});

If you have more difficulties, post in your question the final content of your html and js, because if that were not yet working, the problem will probably become another.

0

The event you want is the .mouseover().

Anything from a look at his documentation, link

Browser other questions tagged

You are not signed in. Login or sign up in order to post.