jQueryUI.Ruler
jQueryUI.Ruler is a jQuery-UI plugin that adds a photoshop-like rules to a DOM element.
Features
- Multiple units (px, mm, cm, in)
- Three types of ticks (major, minor, micro)
- Mouse track
- Supports sub-divs
Tasks
- Add support to more units
- Improve source-code
Usage
// simple initialization; // or use different unit and tick values;
Documentation
Options
unit
Metric unit used by ruler.
Default: px
unit | Description |
---|---|
px | pixel |
mm | millimeter |
cm | centimeter |
in | inch |
Example
// gettervar unit = ;// setter;
tickMajor
Interval of major tick.
Default: 100
Note: 0 to disable
Example
// gettervar tickMajor = ;// setter;
tickMinor
Interval of minor tick.
Default: 20
Note: 0 to disable
Example
// gettervar tickMinor = ;// setter;
tickMicro
Interval of micro tick.
Default: 10
Note: 0 to disable
Example
// gettervar tickMicro = ;// setter;
showLabel
Show or hide major tick value
Default: true
Note: false or otherwise to disable
startX
Value at the origin for the horizontal ruler.
Default: 0
Example
// gettervar startX = ;// setter;
startY
Value at the origin for the vertical ruler.
Default: 0
Example
// gettervar startY = ;// setter;
Methods
refresh()
Refreshes all ruler components
Example
;
License
Licensed under the MIT license.
Similar projects
jQuery.ruler - Add Photoshop-like rulers and mouse position to a container element using jQuery. http://ruler.hilliuse.com
RulersGuides.js - Creates Photoshop-like guides and rulers interface on a web page