2016年1月14日 星期四

於手機及平板上實現拖曳功能

於手機及平板上實現拖曳功能



Using Touch Punch is as easy as 1, 2…

Just follow these simple steps to enable touch events in your jQuery UI app:
  1. Include jQuery and jQuery UI on your page.
    <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
    <script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
  2. Include Touch Punch after jQuery UI and before its first use.
    Please note that if you are using jQuery UI's components, Touch Punch must be included after jquery.ui.mouse.js, as Touch Punch modifies its behavior.
    <script src="jquery.ui.touch-punch.min.js"></script>
  3. There is no 3. Just use jQuery UI as expected and watch it work at the touch of a finger.
    <script>$('#widget').draggable();</script>


參考網頁: http://touchpunch.furf.com/

沒有留言:

張貼留言