Rav*_*thi 4 jquery-ui jquery-ui-resizable jquery-ui-draggable
我使用下面的代码来拖动和调整图像大小,
<!DOCTYPE html>
<html>
<head lang="en">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/>
<script type="text/javascript">
$(document).ready(function() {
$( "#img_content" ).draggable().resizable();
});
</script>
</head>
<body class='default'>
<div class="demo">
<!--<div id="img_content" class="ui-widget-content">
<p>Drag me around</p>
</div>-->
<img id="img_content" class="ui-widget-content" src="Tulips.jpg" />
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
可调整大小正在正常工作.但拖动图像不起作用.如果我申请div结构
<div id="img_content" class="ui-widget-content">
<p>Drag me around</p>
</div>
Run Code Online (Sandbox Code Playgroud)
它的工作正常.
如何为图像标记实现拖动和调整大小?
归档时间: |
|
查看次数: |
15667 次 |
最近记录: |