이것은 바보처럼 들릴지 모르지만 저는 Jquery 멍청한 놈입니다. div 태그를 만들 때 크기를 조정하려고 할 때 휴대 전화에서 좌우로 쓸어 넘기면 왜 한 번만 실행됩니까? 어떤 jquery 전문가가 여기 나를 도울 수 있을까 !! 당신에게jquery 함수가 한 번만 작동하는 이유는 무엇입니까?
감사합니다 여기에 코드
에게 있습니다<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div class="box">
</div>
<script>
$(function right(){
// Bind the swiperightHandler callback function to the swipe event on div.box
$("div.box").on("swiperight", swiperightHandler);
// Callback function references the event target and adds the 'swiperight' class to it
function swiperightHandler(event){
$(event.target).addClass("swiperight");
}
});
$(function left(){
// Bind the swiperightHandler callback function to the swipe event on div.box
$("div.box").on("swipeleft", swiperightHandler);
// Callback function references the event target and adds the 'swiperight' class to it
function swiperightHandler(event){
$(event.target).addClass("swipeleft");
}
});
</script>
</body>
</html>
thx 얘들 아! 그것을 해결했다. 필자는 필자가 왜 문서를 파헤쳐야 하는지를 이해할 필요가 있다고 생각한다 : p –