본문 바로가기

자바스크립트

210114 jquery 메뉴에 마우스를 올렸을 때, 떼었을 때

1. mouseover, mouseout

$('.menu_ul_li')
.mouseover(function() {
	$('.menu_sub_div').show();
	$('.menu_wrap').css({'height':'130px'});
})
.mouseout(function() {
	$('.menu_sub_div').hide();
	$('.menu_wrap').css({'height':'50px'});
});

 

2. hover, (unhover)

$('.menu_wrap' ).hover(
	function(){
		$('.menu_sub_div').show();
		$('.menu_wrap').animate({'height':'130px'},{queue:false,duration:300});
	},
	function(){
		$('.menu_sub_div').hide();
		$('.menu_wrap').animate({'height':'50px'},{queue:false,duration:300});
	}
);
728x90