Bug Tracker

Modify

Ticket #7001 (closed bug: invalid)

Opened 3 years ago

Last modified 14 months ago

live('hover') does not trigger the out handler

Reported by: erezef Owned by:
Priority: undecided Milestone: 1.4.3
Component: event Version: 1.4.2
Keywords: live, hover Cc:
Blocking: Blocked by:

Description

Hi,

The following code does not work. It only calls the handlerIn but forget all about calling the handlerOut.

$(".page .item_list .item").live('hover', function () {

$(this).fadeTo('slow', 0.3);

}, function () {

$(this).fadeTo('slow', 1.0);

});

Thanks, Erez

Change History

comment:1 Changed 3 years ago by dfens

that's right. example:

{{{<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns=" http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>#7001</title> <script type="text/javascript" src="jquery.dev.js"></script> <script type="text/javascript">

$(".item").live('hover', function () {

$(this).fadeTo('fast', 0.0); }, function () { $(this).fadeTo('fast', 1.0); });

</script>

</head> <body id="jq-interior">

<div class="item">put mouse over and out</div>

</body>

</html>}}}

comment:2 Changed 3 years ago by dfens

I'm sorry, it's ok please consider this:

 http://api.jquery.com/live/#multiple-events

$('.hoverme').live('mouseover mouseout', function(event) {
  if (event.type == 'mouseover') {
    // do something on mouseover
  } else {
    // do something on mouseout
  }
});

ticket can be closed.

comment:3 Changed 3 years ago by snover

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to invalid

hover is not an event, it is a function.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.