javascript resize with mouse
I'd like to l开发者_如何学运维et my users resize a div from the 4 corners or the 4 sides with the mouse.
I whish to use just Javascript, no JQ library please...
A tiny little resize image in the right bottom corner would be a plus!
Thanks
Use CSS3 resize: both;
, as seen here: http://dhtmlexamples.com/2011/01/20/creating-a-user-resizable-div-tag-using-css3/
<style type="text/css">
.isResizable {
background: rgba(255, 0, 0, 0.2);
font-size: 2em;
border: 1px solid black;
overflow: hidden;
resize: both;
width: 160px;
height: 120px;
min-width: 120px;
min-height: 90px;
max-width: 400px;
max-height: 300px;
}
</style>
<div class="isResizable">The quick brown fox jumps over the lazy dog.</div>
精彩评论