Mouse events (when passing in an element x) Jquery

0

Well, I'm having problems with mouseenter (). it just triggers the event if I click, I need to pass the event inside an element (div).

How do I do:

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

When I click it it fires, but in fact I need it to fire when I move the mouse.

    
asked by anonymous 29.10.2016 / 04:09

2 answers

1

Ideally, you use the mouseover method, in which case in your PHP would be following form:

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

To make sure the event is being correctly matched you can insert an alert in the item so that a message is triggered 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 contents of your html and js , because if this were still not working, the problem will probably become another.

    
29.10.2016 / 13:23
0

The event you want is .mouseover() .

Anything at a glance at his documentation, link

    
29.10.2016 / 12:37