Reputation: 81
I'm messing around with TouchSwipe jQuery plugin. I successfully added a sort of navigation by swiping left (previous article) and right (next article). If i try my snippet of code alone it works, when i put this on my blog page, with other jQuery code, no way to work...i don't have a specific error. One of my first attempt was to put jQuery.noConflict but...it doesn't work. I can not understand where i'm stuck Any help? This is the code i've made
<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>
Upvotes: 1
Views: 525
Reputation: 459
From your link i saw this:
TypeError: jQuery is undefined
var jQNC = jQuery.noConflict();
this mean jQuery is not defined is like not exist, so you have to make you JQNC variable like this:
var jQNC = $.noConflict();
$ for jquery exist.
Upvotes: 1