This is a js code, it control expand and contract menu. the default action caused by click. How to modify the js code so that change the click action to mouseover and mouseout? Thanks.
HTML Code:
$(document).ready(function() { $('#tab-nav-1 > ul > li > a').click(function() { var $parentItem = $(this).parent(), slideAmt = $(this).next().width(), direction; if (parseInt($parentItem.css('marginLeft'), 10) < 0) { direction = '+='; $(this).removeClass('expanded'); } else { $(this).addClass('expanded'); direction = '-='; } $parentItem .animate({marginLeft: direction + slideAmt}, 400); return false; }); });