首页打开时,会显示div中心内容。我希望用户看到" Left Content"当用户从左向右滑动,然后用户看到"正确的内容"当用户在他或她的触控设备上从右向左滑动时。
<div id=center> Center Content </div>
<div id=left> Left Content </div>
<div id=right> Right Content </div>
JS代码
<Script>
$littlekid = $(document);
$littlekid.ready(
function () {
$littlekid.on("swiperight", function () {
// alert("swiperight");
$littlekid.pagecontainer("change", "index.html#left",
{
transition: "slide",
reverse: true
});
} // End of function( )
) // End of $littlekid.on( ) the first one
.on("swipeleft", function () {
// alert("swipeleft");
$littlekid.pagecontainer("change", "index.html#right",
{
transition: "slide",
reverse: true
});
} // End of function
); // End of $littlekid.on() second
});
</script>
如果我取消注释alert("swipeleft");
和alert("swiperight");
,我可以看到警报就好了。