jquery - 如何使用 jQuery 对图像进行拖放和调整大小?

标签 jquery image drag-and-drop resizable

如何使用 jQuery 调整图像大小并保持其纵横比相同?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>CrossSlide - A jQuery plugin to create pan and cross-fade animations</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

</head>
<body>

<style type="text/css">
#resizebleImage { background: silver; }

</style>

<script type="text/javascript">

$(document).ready(function(){
 $("#resizebleImage").resizable().parent().draggable();  
  });
</script>

<img id="resizebleImage"  src="http://images.askmen.com/galleries/singer/gloria-estefan/pictures/gloria-estefan-picture-4.jpg">
</body>
</html>

最佳答案

哦...呵呵...aspectRatio:true,

关于jquery - 如何使用 jQuery 对图像进行拖放和调整大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2702008/

相关文章:

jquery - jQuery 中的 if 语句总是返回 true

javascript - 当使用 $.getScript() 加载脚本时,有没有办法从使用 $.getScript() 加载的脚本调用父脚本中的函数?

javascript - 使用 JQuery 统计博客文章中的所有单词

ios - 我应该将图像保存在 Core Data 中还是应该使用 SDWebImage

mysql - 删除已删除图像的图像ID

image - 无法从 Firebase 数据库 swift3 加载图像

javascript - jQuery/HTML5 文件API : Why does no drag event appear to be triggering?

javascript - Jquery 可拖动碰撞检测错误

jquery - 使用 jQuery 选择当前匹配元素之后的元素?

drag-and-drop - Angular 2拖放指令非常慢