English 中文(简体)
土著“超声望”5 Drag和“移动式航道”(iPad、iPod、Peter)中的“Droop”?
原标题:Native HTML5 Drag and Drop in Mobile Safari (iPad, iPod, iPhone)?

我已成功执行native RUS5 Drag and Drop for moving HTML elements within a page (just,note, a div from one place to one place, no related to influenceing with the Host Coordinator fileless). 这部建筑在Chatrah和Sato公司进行罚款,但我可以开始在我的IPad sissa开展拖拉行动。

我迄今已发现:

利用Drag和Droop From Java texts

Safari, Dashboard, and WebKit-based applications include support for customizing the behavior of drag and drop operations within your HTML pages.

Note: This technology is supported only on desktop versions of Safari. For iPhone OS, use DOM Touch, described in Handling Events (part of Safari Web Content Guide) and Safari DOM Additions Reference.

Here. But it s outdated (2009-06-08).

任何人都知道能否使用<>斯特凡特> 移动电话的超文本5? (我不想像“ j子”这样的解决办法那样做。)

感谢!

问题回答

我刚刚试图在奥法里(一篮子为14.0.1)找到土生土长的花rag;我正在更新这一答案,因为我的头目结果(似乎还没有其他的q&a)现在。

Following https://developer.apple.com/library/archive/documentation/AppleApplications/Conceptual/SafariJSProgTopics/DragAndDrop.html I have found native html5 drag&drop now works in safari, with a few specific notes;

  • (效果环境似乎是任择性的)

  • 页: 1 否则,聋 the人将装上你补充的数据(除非你打算这样做)

  • OnDragOver event handler needs Event.preventDefault(); otherwise drop fails (unless intended, as docuemnted)

  • 如果你制定<代码> OnDragStart s Event.data Transfer.dropEffect=拷贝/code>和。 OnDragOver s Event.datatransfer.dropEffect=link the abolition. . . 跌倒闭(无OnDrop(<>>); 种子是唯一失败的组合

我认为,你需要你帮助。

  • CSS -webkit-user-drag: Element; and `-webkit-user-drop: element; or if you prefer
Element.style.setProperty( webkitUserDrag , element );
Element.style.setProperty( webkitUserDrop , element );

but it seems just the usual draggable attribute is enough Element.setAttribute( draggable ,true);

看来,这似乎只是微乎其微的拖拉和安放,而放弃了部分。

        Element.setAttribute( draggable ,true);
        
        function OnDragOver(Event)
        {
            Element.setAttribute( DragOver ,true);
            Event.stopPropagation();    //  let child accept and don t pass up to parent element
            Event.preventDefault();     //  ios to accept drop
            Event.dataTransfer.dropEffect =  copy ;//   move has no icon? adding copy shows +
        }
        function OnDragLeave(Event)
        {
            Element.removeAttribute( DragOver );
        }
        function OnDrop(Event)
        {
            Element.removeAttribute( DragOver );
            Event.preventDefault();     //  dont let page attempt to load our data
            Event.stopPropagation();
        }
        function OnDragStart(Event)
        {
            Event.stopPropagation(); // let child take the drag
            Event.dataTransfer.dropEffect =  move ;
            Event.dataTransfer.setData( text/plain ,  hello );
        }
        Element.addEventListener( dragstart ,OnDragStart);
        Element.addEventListener( drop ,OnDrop);
        Element.addEventListener( dragover ,OnDragOver);
        Element.addEventListener( dragleave ,OnDragLeave);

现在,在Safari(包括流动)也开展了电视活动。 本条有一条 n,可以从:

http://www.html5rocks.com/en/mobile/touch/





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!