(Vegvisir 3)
vegvisir.Navigation.TARGET
Defines the target
element of a navigation triggered from a bound element.
This object follows the same syntax as the target
attribute of HTMLAnchorElement
.
If a string is provided to a target
attribute of the bound element that isn't in this enumerable, the string will be treated as a CSS selector.
These values correspond to the value of a target
attribute on a bound element.
_top
Target vegvisir.Navigation.rootShellElement
. This is the same as performing a normal soft-navigation.
This is the default behavior if a target
attribute is omitted or equals an empty string.
_self
Target the bound element itself with the defaults vegvisir.Navigation.POSITION.BEFOREEND
and vegvisir.Navigation.MODE.REPLACE
, which will replace the bound element itself with the contents of the destination URL.
The default position and mode behavior can be overridden with by setting a vv-position
and vv-mode
attribute on the bound element respectivly.
_blank
Default browser behavior. The destination URL will open in a new tab or window.
_parent
Target the closest parent HTMLElement that has a vv-page
attribute.
vegvisir.Navigation.rootShellElement
will become the target if no parent is found.
The value of the bound element's target
attribute will be treated as a CSS selector if the string value does not equal an entry in this enumerable.
Here's an example that uses a native anchor tag to do various navigations.
= Snippet::put("docs/API/JS/Navigation/TARGET/example-0-0", Snippet::PHP) ?> = Snippet::put("docs/API/JS/Navigation/TARGET/example-0-1", Snippet::PHP) ?>