Coder Social home page Coder Social logo

rafasashi / jquery-canvas-area-draw Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fahrenheit-marketing/jquery-canvas-area-draw

0.0 3.0 0.0 30 KB

Canvas based ImageMap polygon editing textarea/input replacement for jQuery

Home Page: http://iakob.com/canvas-area-draw/demo.html

License: Other

JavaScript 84.12% HTML 15.88%

jquery-canvas-area-draw's Introduction

jQuery ImageMap Area Canvas Editor

jQuery plugin to create imagemap area polygon coordinates. Extends a text input to display an image with a canvas on which points may be added to create a polygon.

Activates inputs with class canvas-area and data attribute data-image-url. Or activate with $('input').canvasAreaDraw(options)

Demo at [http://iakob.com/canvas-area-draw/demo.html]

Examples

Include the javascript file in your page after jQuery and add class and data parameters to your inputs or textareas:

<textarea class="canvas-area" data-image-url="http://example.com/image.png"></textarea>

Or using Javascript, include the script after jQuery and activate it on any selection of text inputs or textarea elements. If you are applying it to multiple elements, you may wish to still use the data-image-url to set a different image for each input. If you include the imgUrl property in the options object, the same image will be applied to all elements in the selection.

<input type="text" id="polygon">

<script>
(function(jQuery) {
  $('#polygon').canvasAreaDraw({
    imageUrl: "http://example.com/image.png"
  });
})(jQuery);
</script>

You may want to use a document load or ready event to make sure your elements are already added to the DOM before you invoke the plugin.

jquery-canvas-area-draw's People

Contributors

singlow avatar zlo2k avatar clockworkorange605 avatar linntroll avatar

Watchers

James Cloos avatar Raphaël Dartigues avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.