Convert jquery to javascript code

2.4k Views Asked by At

if you can, please advise me how to:

  1. I need to convert this a nice script, to pure javascript without jquery.
  2. Very important! The selection area Need to keep aspect ratio.

http://www.script-tutorials.com/html5-image-crop-tool/

1

There are 1 best solutions below

2
On

Well, i don't know why you need that but you need to use HTML DOM / Mouse Events instead of jQuery events:

object.onmousemove

object.onmouseup

object.onmousedown

Also you need to use an inmediate function instead the jQuery document ready shortcut $(function(){...}):

(function(){
  // ... your code goes here
})()