Problems with the sequence of operations in jQuery IE7

The question was asked: 7 years 0 months ago   views: 23
0

How to solve the problem trivial sequence of operations jquery in IE7?

Code:

$('.zonekat li').hover(function(){ 

 var thisin = $(this).html();
 alert(thisin); 
$(this).append("<div></div>");

}

On hover element occurs two operations (alert to debug).

  1. Caching the html source code of the element in a variable thisin;
  2. Adding in a div element.

Problem occurs in IE7, when these two operations occur simultaneously without a chain sequence and a variable thisin cached code with the div added.

How to solve the problem?

Asked: 30-05-2012 в 16:37:35

Answers   1

0

If this is all of the code for hover, then you have it activated twice on hover and leave. Maybe you think the second call incorrect, I Have something in IE9 with browser mode IE7 works as written, i.e., correct.

email:

$('.zonekat li').hover(function(){

 var thisin = $(this).html();
 alert(thisin); 
$(this).append("<div></div>");

},function(){});

maybe the problem will be gone...

PS .hover() - jQuery API

Answered: 30-05-2012 в 17:40:23
I think that if the reverse action to hover there, then it is better not to use it, and catch the mouseover or mouseenter - 30-05-2012 в 17:52:46
Thank you. The problem is solved by placing the mouseover or mouseenter event - 30-05-2012 в 18:48:25
Welcome to my blog! Sorry for pure English )) - 30-05-2012 в 18:51:59