메뉴 건너뛰기

HEUKMYO

Mobile

모바일웹 슬라이드(Swipe)-jqueryMobile을 이용한 swipe 구현
2013.03.05 09:54:07


jquery-1.6.1.min.js는 jquery 파일

jquery.mobile-1.0b1.min.js는 jqueryMobile js 파일



$(document).ready(init);
var nSwipeCount = 0;
var nSwipeLeftCount = 0;
var nSwipeRightCount = 0;
function init()
{
$("#content").bind("swipe", function (event)
{
$("#txtSwipe").text("swipe " + ++nSwipeCount);
});
$("#content").bind("swipeleft", function (event)
{
$("#txtSwipeLeft").text("swipeleft " + ++nSwipeLeftCount);
});
$("#content").bind("swiperight", function (event)
{
$("#txtSwipeRight").text("swiperight " + ++nSwipeRightCount);
});
}


<DIV id=content>
<H3 id=txtSwipe>swipe 0</H3>
<H3 id=txtSwipeLeft>swipeleft 0</H3>
<H3 id=txtSwipeRight>swiperight 0</H3>
</DIV>

위로