Guide

Vecta.Guide

new Vecta.Guide([node], [orient])

Vecta Guide object.

NameTypeAttributesDescription
nodestring|Elementoptional

A valid string ID for the guide or the guide node or JQuery object. If null or undefined, will create a new guide.

orientbooleanoptional

False or undefined for horizontal guides, and true for vertical guides

Examples:
var guide = new Vecta.Guide(null, true); //creates a vertical guide

Properties

.$jQuery

The jQuery wrapped node for the guide.

NameTypeDescription
$jQuery

jQuery wrapper for guide node.

Methods

.delete()

Delete a guide from the page.

.id() Returns: string

Get the guide id. Read only.

Returns:

Returns the guide ID.

.move([x], [y]) Returns: Object|Vecta.Guide

Get or set position of guide.

For get operations, both x and y must be undefined or not provided. If any one of the parameters is provided, then it is considered a set operation.

For set operations, if either x or y is not provided, then the current value is used in replacement. Both x and y can be numbers (px) or valid length strings, eg: 1in, 1 mm, 10 px.

If any of the provided parameters is an invalid length, then the operation fails with an error message in console.

NameTypeAttributesDescription
xnumber|stringoptional

X coordinate of guide.

ynumber|stringoptional

Y coordinate of guide.

Returns:

Returns the x and y coordinates if get or Vecta.Guide if set.

For get operations, the returned object will be in the following format:

{x: number|string, y: number|string}

where the type for x and y coordinates may be in numbers (px) or valid length strings.

Examples:
var guide = new Vecta.Guide('#123');

guide.move(0, 10); //move the horizontal guide to 10px
console.log(guide.move()); //{x: 0, y: 10}

.page() Returns: Vecta.Page

Get the guide's containing page.

Returns:

Returns a Vecta.Page object containing the current guide.

Examples:
var guide = new Vecta.Guide('#123');

console.log(guide.page.id()); //displays the guide's containing page id
Capital™ Electra™ X