我在玩TouchSwipe jQuery插件。我通过滑动左(上一篇文章)和右(下一篇文章)成功地添加了一种导航。如果我单独尝试我的代码片段,当我将它与其他jQuery代码放在我的博客页面上时,就无法工作了……我没有具体的错误。我的第一次尝试是让jQuery.noConflict but...it不起作用。我不知道我被困在哪里了有什么帮助吗?这是我做的代码
<script>
$(function() {
//Enable swiping...
$("#test").swipe({
//Generic swipe handler for all directions
swipeLeft: function(event, direction, distance, duration, fingerCount) {
window.location.href = "http://stackoverflow.com";
},
swipeRight: function(event, direction, distance, duration, fingerCount) {
window.location.href = "http://google.com";
},
threshold: 0
});
});
</script>发布于 2014-02-24 14:59:36
从你的链接中我看到了这个:
TypeError: jQuery is undefined
var jQNC = jQuery.noConflict();这意味着没有定义jQuery就像不存在一样,所以必须使JQNC变量如下所示:
var jQNC = $.noConflict();$ for jquery存在。
https://stackoverflow.com/questions/21991085
复制相似问题