如何使用jquery draggable拖动带有下面的组合框的图像。
我不知道我是否需要创建一个 Div 并在里面放置图像和组合框。
我已经有可拖动的图像,但我不确定如何将组合框放在下面。
如果没有列出任何代码,很难分辨,但这是可拖动文档中的设置:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Draggable - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<style>
#draggable { width: 150px; height: 150px; padding: 0.5em; }
</style>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#draggable" ).draggable();
} );
</script>
</head>
<body>
<div id="draggable" class="ui-widget-content">
<p>Drag me around</p>
</div>
</body>
</html>
似乎您需要 id 为"可拖动"的元素下方的框。您可以将框设置为可放置,就像使用 $( "#draggable" (.draggable((;
但同样,代码示例将非常有帮助。