0

I wanna change the size of an element by mouse(or touch in mobile) using javascript ( pure javascript or css ,that's better if possible). And it must be very smooth both in mobile and desktop(I wanna do an online editor,smooth is importnat).

And I know one way to do that using jquery:

$( "#resizable" ).resizable();
  }); 

I wonder how to do that effect in pure js or css only? or do you have a more efficient way to do that in an online editor using just html and javascript?

Frank Lee
  • 161
  • 10
  • Not using jquery,I am considering it's to big for mobile and i donot want the online-editor too big, so I thought it will be better if i code it using pure javascript or css, and also practice my learning of javascript. I hate frameworks like jquery in which you need to upload all stuff ,which most you don't use at all. – Frank Lee Dec 08 '15 at 04:37
  • 1
    Seems like a duplicate question to me. [See here.](http://stackoverflow.com/questions/8960193/how-to-make-html-element-resizable-using-pure-javascript) – Battousai Dec 08 '15 at 04:54

1 Answers1

1

You Can use the code from the below link and use it as your requirements

Tanmay
  • 590
  • 8
  • 20
  • just using mouse to drag it so that the width of the div can be changed dynamically – Frank Lee Dec 08 '15 at 12:33
  • You Can use the code from the below link and modified it as per your wish but in js it will be bit lengthy . Link is http://codepen.io/zz85/pen/gbOoVP – Tanmay Dec 08 '15 at 12:44
  • IT seems very good example for me. I will look more deep into it. Thanks – Frank Lee Dec 08 '15 at 12:50
  • you can remove that div and can work without it and delete all the reference in the code it is just to set the boundary on first look it seems – Tanmay Dec 08 '15 at 13:36
  • Could you please edit this answer so it contains the complete solution instead of requiring future visitors to read the comment thread to understand how to solve the issue? – josliber Dec 19 '15 at 20:32