jQuery UI sortable not working in iPAD -
i using jquery ui sortable functionality. works fine in browsers. in touch device such ipad is not working. below code using
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <script src="js/jquery.ui.touch-punch.js"></script> <script> $(function() { $( ".documents" ).sortable(); $( ".documents" ).disableselection(); });
my html is:
<div id="bodycontainer"> <ul class="documents"> <li>1</li> <li>2</li> <li>3</li> </ul> </div>
please let me know solution asap. thank in advance.
ok, obvious, because jquery ui library not include touch events. if develop jquery powered web site, using jquery ui functionalists of wont work in touch enable mobile devices. in case have used sortable()
method example.
there solution can implement. can use jquery ui touch punch plugin overcome issue (as used).
please make sure jquery.ui.touch-punch.js file load or not. think if loading correctly should work.
also can clear browser cache. (in ipad settings > safari > clear cookies , data)
here working example :
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <script src="https://raw.github.com/furf/jquery-ui-touch-punch/master/jquery.ui.touch-punch.min.js"></script> <script> $(function() { $( ".documents" ).sortable(); $( ".documents" ).disableselection(); }); </script> <div id="bodycontainer"> <ul class="documents"> <li>1</li> <li>2</li> <li>3</li> </ul> </div>
Comments
Post a Comment