Selecte Rectangle Areas Of An Image - jQuery AreaSelectable

File Size: 146 KB
Views Total: 3355
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Selecte Rectangle Areas Of An Image - jQuery AreaSelectable

AreaSelectable is a small jQuery plugin which makes it possible to highlight & select rectangle areas of an image you provide.

Great for online image editing tool that allows the user to select parts of an image for further operations.

How to use it:

1. Embed an image into the page.

<img id="demo" src="example.jpg" width="600" height="450">

2. Load jQuery JavaScript library and the minified version of the jQuery AreaSelectable plugin at the end of the document.

<script src="" 
<script src="dist/areaSelectable.min.js"></script>

3. Call the function areaSelectable on the image and done.




4. Enable multiple selection on the image.

  allowMultiple: true

5. Set the pre-selected area.

  allowMultiple: true,
  x: 5,
  y: 5

6. Customize the styles of the selected areas.

  areaClass: "area", 
  color: "#cd0000", // background color
  opacity: ".6"

7. More configuration options.

  splitOperator: ",",
  width: "auto",
  height: "auto",
  createHidden: true,
  name: "", // input name

8. Callback functions available.

  onAfterSelect: function(status, id) {},
  onBeforeSelect: function(status, id) {},
  onSelected: function(id) {},
  onDeselected: function(id) {}

9. Set the pre-selected area programmatically.

$("#example").areaSelectable('setSelected', [2, 3, 4]);

10. Get the selected area(s).


This awesome jQuery plugin is developed by berkaygure. For more Advanced Usages, please check the demo page or visit the official website.