내 코드가 작동하지 않는 이유를 모르겠다 ...jquery .animate()가 작동하지 않습니다.
클릭했을 때 제목의 색상을 애니메이트하고 싶습니다.
나머지는 애니메이션이 필요 없으며 잘 작동하기 때문에이 단순한 부분으로 페이지를 축소했습니다.
다음은 JSFiddle
HTML
<head>
<script src="Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="Scripts/Script.js" type="text/javascript"></script>
</head>
<div id="Nav">
<h2>About</h2>
<h2>Works</h2>
<h2>Contacts</h2>
</div>
CSS
#Nav {
position: fixed;
top: 0;
left: 0;
padding: 10px;
z-index: 2;
}
#Nav h2 {
display: table;
color: #353535;
}
#Nav h2:hover {
cursor: pointer;
}
JQUERY
function sortEvents() {
$("#Nav h2").click(function() {
$("h2").animate({ "color": "#f49d29" }, 1500);
})
}
jQuery를 색상 애니메이션을 수 없습니다. https://github.com/jquery/jquery-color와 같은 플러그인이 필요합니다. – Spokey