draggable and resizable image using jQuery
you can do it without any jQuery plugins.
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.9.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.9.custom.min.js"></script>
<script type="text/javascript">
$(function() {
$("#image_container")
.resizable({alsoResize:"#panther"})
.draggable()
.css({'width': '500px', 'height': '500px'})
});
</script>
<div id="image_container">
<img id="panther" src="panther.jpg" width="500px" height="500px" />
</div>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.9.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.9.custom.min.js"></script>
<script type="text/javascript">
$(function() {
$("#image_container")
.resizable({alsoResize:"#panther"})
.draggable()
.css({'width': '500px', 'height': '500px'})
});
</script>
<div id="image_container">
<img id="panther" src="panther.jpg" width="500px" height="500px" />
</div>
댓글
댓글 쓰기