Aza*_*ung 5 html javascript css jquery jquery-ui
正如标题所说,我正试图在Sufrace Pro 3平板电脑上实现拖放.
这些设备是否支持拖放功能?如果是这样,我将如何启用此功能?如果没有,我该如何解决这个问题?
我正在努力让jQuery UI的拖放功能正常工作.这是我想要工作的基本示例:
$( "#draggable" ).draggable();Run Code Online (Sandbox Code Playgroud)
#draggable {
width: 200px;
height: 200px;
border: 1px solid;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<div id="draggable">
<p>Drag me around</p>
</div>Run Code Online (Sandbox Code Playgroud)
我有一段时间有类似的问题.您需要将所需元素的touch-action属性更改为none.在这种情况下,由于您使用的是jQueryUI,因此您可以将其应用于.ui-draggable/ .ui-droppableelements.
您还需要添加-ms供应商前缀,因此您将使用-ms-touch-action: none:
.ui-draggable, .ui-droppable {
-ms-touch-action: none;
touch-action: none;
}
Run Code Online (Sandbox Code Playgroud)