【发布时间】:2012-04-05 09:35:36
【问题描述】:
我正在尝试将 Skinkers Labs 的 TouchSwipe 插件与 jQuery Mobile 结合在我正在创建的一个移动网站上,该网站也使用响应式设计。
触摸滑动: http://labs.skinkers.com/touchSwipe/
我遇到的情况是,我可以让 TouchSwipe 插件在移动设备上的普通页面上正常工作,但是一旦我添加了 jQuery Mobile js 文件,TouchSwipe 功能就不再起作用了。
这是我收到的 JS 错误(在 jquery-1.7.1.js 的第 3256 行):
TypeError: 'undefined' 不是函数(评估 '( (jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler ) .apply(matched.elem, args )')
这里是我在 HTML 中包含 JavaScript 的地方:
<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="js/jquery.touchSwipe-1.2.5.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript">
$("#divCheckingWrapper").live("pagecreate", function(event) {
var swipeOptions = {
swipeStatus: swipeStatus,
allowPageScroll: "vertical"
};
SWIPEABLE_NODES = $("#divCheckingSlider");
SWIPEABLE_NODES.swipe(swipeOptions);
CONTENT_WIDTH= SWIPEABLE_NODES.parent().width();
MAX_NODES = SWIPEABLE_NODES.find("div.divCheckingSliders").length;
});
</script>
<script type="text/javascript" src="js/jquery.mobile-1.1.0-rc.1.min.js"></script>
main.js 包含来自 TouchSwipe 站点的 Image Swipe 示例代码中的所有辅助函数:
http://labs.skinkers.com/touchSwipe/demo/image_scroll.php
知道为什么我会看到此错误吗?一旦我删除了 jQuery Mobile javascript 文件,插件就可以正常工作,但我需要 jQuery Mobile 用于该站点。
如果您愿意,我很乐意发布更多代码。如果您有任何问题或需要更多信息,请告诉我。
提前感谢您的帮助!
【问题讨论】:
标签: javascript jquery jquery-plugins jquery-mobile