hover vs mouse enter (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<div class="fl our_customers_content_menu_in">
                                <div class="pos our_customers_content_menu_in1">
                                        <img src="images/our_customers_commercial_buildings.png" alt="commercial_buildings" act="1" style="bottom:0px;"/>
                                <div class="pos our_customers_content_img" style="bottom:0px;left:0px;">
                                        <img src="images/our_customers_commercial_buildings_act.png" alt="commercial_buildings" style="bottom:0px;"/>
                                </div>
                                </div>
                        </div>

Test runner

Ready to run.

Testing in
TestOps/sec
mouseenter
$('.our_customers_content_menu_in1').hover(function() {
 if ($(this).find('img').eq(1).attr('act') == 2 || $(this).find('img').eq(2).is(':animated')) {} else {
  $(this).find('img').fadeOut(500);
  $(this).find('.our_customers_content_img').fadeIn(1000);
 }
}, function() {
 if ($(this).find('img').eq(1).attr('act') == 2 || $(this).find('img').eq(1).is(':animated')) {} else {
  $(this).find('img').fadeIn(0);
  $(this).find('.our_customers_content_img').fadeOut();
 }
});
ready
test 2
$('.our_customers_content_menu_in1').mouseenter(

function() {
 if ($(this).find('img').eq(1).attr('act') == 2) {} else {
  $(this).find('.our_customers_content_img').not(':animated').fadeIn(400);
 }
}).mouseleave(

function() {
 if ($(this).find('img').eq(1).attr('act') == 2) {} else {
  $(this).find('.our_customers_content_img').fadeOut(400);
 }
});
ready
test 3
$('.our_customers_content_menu_in1').mouseenter(

function() {
 if ($(this).find('img').eq(1).attr('act') == 2) {} else {
  $(this).find('.our_customers_content_img').not(':animated').fadeIn(400);
 }
}).mouseleave(

function() {
 if ($(this).find('img').eq(1).attr('act') == 2) {} else {
  $(this).find('.our_customers_content_img').fadeOut(400);
 }
});
ready
live mouseenter mouseleave
$('.our_customers_content_menu_in1').live('mouseenter mouseleave', function(e) {
 if (e.type == 'mouseover') {
  if ($(this).find('img').eq(1).attr('act') == 2) {} else {
   $(this).find('.our_customers_content_img').not(':animated').fadeIn(400);
  }
 }
 else {
  if ($(this).find('img').eq(1).attr('act') == 2) {} else {
   $(this).find('.our_customers_content_img').fadeOut(400);
  }
 }
});
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.