jquery touch punch - draggable on ipad

Posted by dshuta on Stack Overflow See other posts from Stack Overflow or by dshuta
Published on 2012-03-22T23:13:24Z Indexed on 2012/03/22 23:29 UTC
Read the original article Hit count: 185

Filed under:
|

i am starting to work with the jquery touch punch extensions in order to allow draggability on ipad, but i am getting tripped up right away. probably something terribly dumb on my part. the draggable example from the developer works fine on my ipad:

http://furf.com/exp/touch-punch/draggable.html

but not for me:

http://danshuta.com/touchpunch/

this works fine in my desktop browser, but on the ipad it just focuses on the block and scrolls the entire page as i drag, as if it were just an image or other normal embedded object. as this is what happens normally with jquery/ui on ipad, this makes me think it is not loading or otherwise ignoring the "punch" code from my site (though if i host the jquery files on my site via the same path, those load and function fine in desktop browser). here's the entire code, very basic:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Touchpunchtest</title>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.8.17/jquery-ui.min.js"></script>
<script src="js/jquery.ui.touch-punch.js"></script>
</head>
<body>
<div id="draggybox" onclick="void(0)" style="width: 150px; height: 150px; background: green;"></div>
<script>$('#draggybox').draggable();</script>
</body>
</html>

what am i missing?!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about iPad