开发者

need short line of code to enable jQuery drag and drop work on iphone?

开发者 https://www.devze.com 2023-03-10 15:30 出处:网络
I developed a w开发者_开发百科eb based game by use of jQuery drag and drop.As everyone knows that; jQuery drag and drop is not work on touch screen.Is there any short and simple code to enable work on

I developed a w开发者_开发百科eb based game by use of jQuery drag and drop. As everyone knows that; jQuery drag and drop is not work on touch screen. Is there any short and simple code to enable work on iphone.

how to make the code below draggable work on touch devices such as iphone or ipad

 $(document).ready(function () {
        $("image").draggable({
            start: function (event, ui) {
                imgID = $(ui.helper)[0].id;

            }
        });

and for droppable:

     $("div#boardGame div").droppable({
            drop: function (event, ui) {
                game.WebService1.DoTurn(this.id,
                                              imgID,
                                              onDoTurn);


            }
        }); 
0

精彩评论

暂无评论...
验证码 换一张
取 消