Featured Products
- Home
- JavaScript Scripts
- dbRuler
dbRuler
By : ShardSky Published on Tuesday, May 09, 2017,00:42:08 in JavaScript Scripts
dbRuler dbRuler is a lightweight jQuery and canvas based plug-in featuring the most common options for web development. Ruler can be used in full screen size and in container. Plug-in is full responsive. Compatable with any kind of devices. It can be used as custom ruler with user defined data. Futuremore the app can be used as a pixel ruler. Fully customizable. Compatable with any kind of browsers inclusive IE8 (for IE8 include: â<!-[if lte IE 8]><script type=âtext/javascriptâ src=âexcanvas.jsâ></script><![endif]->â in head tag). 1. Usage: â HTML Markup is just canvas tag with width and height according options if provided or container size if there is no options. 2. Includes: â jQuery: <script type=âtext/javascriptâ src=âjquery-3.2.1.min.jsâ></script> â ruler script: <script type=âtext/javascriptâ src=âdb-ruler.jsâ></script> 3. Initiation: â Default options example: $(â.target-elementâ).dbRuler(); - Props initiation example:
$(â.target-elementâ).dbRuler({ width: 768, height: 120, step: 15 });
4. Options list: width: int â default: container width (responsive â 100% width of parent)
- User can assign custom width or use containers width
height: int â default: container height (responsive â 100% height of parent) â User can assign custom height or use containers height
step: int â default: 15 â Property step defines distance in pixels bethween ruler divisions
titlesCount: int â default: 7 â Property titlesCount indicates count of bigger divisions on the ruler by default they are bigger from other divisions. Futuremore above them can exists additional text (titles and subtitles) which can be (Measure, DateTime or what else user need)
font: string â default: â15 serifâ â Property font declares font size and type of the ruler text
color: string â default: âblackâ â Property color defines color of the divisions and text on the ruler
divisionHeight: int â default: 5 â Property divisionHeight defines how long to be each of the divisions
divisionWidth: int â default: 1 â Property divisionWIdth defines how width to be each of the divisions
titleDivisionHeight: int â default: 9
- Property titleDivisionHeight defines how long to be each of the title divisions
titleDivisionWidth: int â default: 1 â Property titleDivisionWidth defines how width to be each of the title divisions
margin: int â default: 0 â Property margin defines difference bethween ruler divisions and ruler border. Leave 0 (default) to start every time immediate from ruler border
titleMargin: int â default: 0 â Property titleMargin defines difference bethween ruler title divisions and ruler border. Leave 0 (default) to start every time immediate from ruler border
titles: array â default: [] â Property titles contains titles text which will be written above the title divisions to indicate Measure, DateTime or what user need to show on ruler. This property can be used if type option is set to custom
titlesDistance: int â default: 25 â Property titlesDistance indicates distance (in pixels) bethween title text and ruler border
titlesDiverge: int â default: 0 â Property titlesDiverge indicates how pixels from center (according title division) to be title text diverged
subtitles: array â default: [] â Property subtitles contains subtitles text which will be written above the titles text. This property can be used if type option is set to custom
subtitlesDistance: int â default: 40 â Property subtitlesDistance indicates distance (in pixels) bethween subtitle text and ruler border
subtitlesDiverge: int â default: 0 â Property subtitlesDiverge indicates how pixels from center (according title division) to be subtitle text diverged
side: string (inner/outer) â default: âinnerâ â Property side indicates in which side of the ruler to be the units drawn
direction: string (vertical/horizontal) â default: âverticalâ â Property direction indicates are we attend to write vertical or horizontal ruler
type: string (custom/pixel) â default: âcustomâ â Property type indicates what kind of ruler we are attend to draw (custom or pixel). â pixel ruler will automatically measure pixels on itself in dependenxe of step and size (width: if horizontal or height: if vertical) â custom ruler will measure what is provided in titles and subtitles



