Draw a line between two given points with just a div and CSS
JavaScript HTML CSS
Switch branches/tags
Nothing to show
Latest commit 51ffaff Jan 17, 2017 @tbem committed on GitHub Merge pull request #10 from akamola/master
Add class option
Permalink
Failed to load latest commit information.
example Add class option Jan 17, 2017
README.md Add class option Jan 17, 2017
jquery.line.js Add class option Jan 17, 2017

README.md

jquery.line

Draw a line between two points in the given container.

Usage:

$(selector).line(x1,y1,x2,y2,options,callback);

//Assuming that #example have position:relative or absolute.

$('#example').line(0, 0, 20, 20);

You can pass some options like color, stroke width or zindex, and a callback function:

Defaults are: { zindex : 10000, color : '#000000', stroke: '1', style: 'solid', class: 'line', }

Example:

$('#example').line(10, 10, 300, 300, {color:"#D60004", stroke:5, zindex:1001}, function(){alert('Hello new line!')});

Open index.html in the 'example' folder on your browser to see some lines.