I am trying to use yepnope
with Modernizr
and Hammer.js
to detect and trigger touch events for a slider. This is my code. I have two errors in console and don't manage to debug. Plus I don't understand where this <
error comes from. If I remove the following bit of code, both errors disappear.
Any clue?
var slider = $('#featured');
yepnope({
test: Modernizr.touch,
yep: [ "/assets/javascripts/jquery.hammer.js", "/assets/javascripts/hammer.js"],
nope: [''],
complete: function () {
slider.hammer({drag: false}).bind("swipe", function (ev) {
if(ev.direction === 'left'){
slider.trigger("orbit.next");
} else if(ev.direction === 'right'){
slider.trigger("orbit.prev");
}
});
}
});
I have the following errors in my console.
SyntaxError: Unexpected token '<'
TypeError: 'undefined' is not a function (evaluating 'slider.hammer({drag: false})')