Skip to content Skip to sidebar Skip to footer

Javascript Resize With Mouse

I'd like to let 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 ri

Solution 1:

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>

Post a Comment for "Javascript Resize With Mouse"