JQuery에서 배경 애니메이트 메서드를 사용하려고하지만 작동하지 않습니다. 여기에 내가 사용하고있는 코드가 있습니다.Jquery 배경 애니메이션
$(".menu_item").mouseenter(function(){$(this).animate({backgroundColor: "#FF8040"}, 'fast');});
$(".menu_item").mouseleave(function(){$(this).animate({backgroundColor: "#999"}, 'fast');});
감사합니다. 감사드립니다.
Heres 나머지 부분.
다음은 메뉴에 대한 HTML :
<div id="menu">
<a href="index.html" id="home_menu" class="menu_item">Home</a>
<a href="index.html" class="menu_item">Tutorials</a>
<a href="index.html" class="menu_item">News</a>
</div>
하고 스크립트가 :
<script type="text/javascript">
$(document).ready(function(){
jQuery().ready(function(){
$(".menu_item").mouseenter(function(){$(this).animate({backgroundColor: "#FF8040"}, 'fast');});
$(".menu_item").mouseleave(function(){$(this).animate({backgroundColor: "#999"}, 'fast');});
var pos = $("#fixed_head").position();
var height = $("#fixed_head").height();
var height2 = $("#menu").height();
var screenHeight = $("body").height();
var newHeight = screenHeight - height - height2;
$("#container").css("top", (pos.top + height));
$("#container").css("height", newHeight);
$("#content").css("height", newHeight);
$(window).resize(function() {
var pos = $("#fixed_head").position();
var height = $("#fixed_head").height();
var height2 = $("#menu").height();
var screenHeight = $("body").height();
var newHeight = screenHeight - height - height2;
$("#container").css("top", (pos.top + height));
$("#container").css("height", newHeight);
$("#content").css("height", newHeight);
});
});
});
</script>
과 머리에
: 당신이 jQuery UI 라이브러리를 사용하는 경우<script type="text/javascript" src="jquery.js"></script>
샘플 HTML을 제시해주십시오. –
주의해서, 중첩 된 DOM 준비 핸들러는 필요 없습니다. 처음에만 사용하십시오. – VisioN
그래, 내가 그걸 알아 냈어, 그냥 그것을 제거하지 않았다. 그러나 이것에 변화를주는 것처럼 보이지는 않습니다. UI 용으로 추가 Jquery 파일이 필요합니까? – FabianCook