JQuery UI의 animate()를 사용하여 마우스를 가져갈 때 색상이 바뀌는 버튼이 있습니다. 버튼을 클릭하면 AJAX가있는 페이지가로드됩니다. 그 버튼을 클릭하면 animate()가 작동하지 않는 것입니다. 단 하나의 색상으로 정지됩니다. AJAX load() 후 JQuery UI animate()가 작동하지 않습니다.
<!DOCTYPE html>
<html>
<head>
<title>Jquerytest</title>
<link rel="stylesheet" href="styles.css" />
<script src="lib/jquery-3.1.1.js"></script>
<script src="lib/jquery-ui-1.11.2/jquery-ui.js"></script>
<script>
$('document').ready(function() {
var menubutton_animation = 200;
$('.menubutton').hover(function(){
$(this).animate({ color: "#D1571F" }, menubutton_animation);
}, function(){
$(this).animate({ color: "#000000" }, menubutton_animation);
});
$('.menubutton').click(function(){
$('#targetframe').load('portfolio.html');
});
});
</script>
</head>
<body>
<input class="menubutton" type="button" value="Portfolio" id="portfolio">
<div id="targetframe"></div>
</body>
</html>
을 styles.css
이 포함되어 있습니다@font-face {
font-family: 'Comfortaa';
src: url('Comfortaa.eot'),
url('Comfortaa.ttf') format('truetype');
}
.menubutton {
height:40px;
background:transparent;
border:none;
color:#000000;
cursor: pointer;
font-family:Comfortaa;
font-size:30px;
}
미리 감사드립니다.
개발자 콘솔에 버튼을 클릭 한 후에 오류가 표시됩니까? –
이 XMLHttpRequest 오류 : 최종 사용자의 경험에 해로운 영향을주기 때문에 주 스레드의 동기 XMLHttpRequest는 더 이상 사용되지 않습니다. 도움이 더 필요하면 https://xhr.spec.whatwg.org/를 확인하십시오. 나는 그것이 관련 있다고 생각하지 않는다 – gabyarg25