What steps will reproduce the problem?
1. Include the altfix version of the code
2. Call $('el').addTouch() after including the altfix touch library
3. See error in firebug $('el').addTouch() not a function
What is the expected output? What do you see instead?
addTouch() function to exist
What version of the product are you using? On what operating system?
altfix version of the plugin with jquery 1.6
Please provide any additional information below.
I ran into this issue and solved it by initiating the plugin after jquery has
loaded. The method used: $(function() { does not work if the dollar sign has
been stolen. Use the following instead
(function ($) {
//
// Extend jQuery feature detection
//
$.extend($.support, {
touch: "ontouchend" in document
});
//
// Hook up touch events
//
$.fn.addTouch = function() {
if ($.support.touch) {
this.each(function(i, el) {
el.addEventListener("touchstart", iPadTouchHandler, false);
el.addEventListener("touchmove", iPadTouchHandler, false);
el.addEventListener("touchend", iPadTouchHandler, false);
el.addEventListener("touchcancel", iPadTouchHandler, false);
});
}
return this;
}
})(jQuery);
Original issue reported on code.google.com by jamesmeh...@gmail.com on 7 Jun 2011 at 5:53
Original issue reported on code.google.com by
jamesmeh...@gmail.com
on 7 Jun 2011 at 5:53