Q4Widgets API Documentation

q4.nav

The Nav widget acts as a service and controller of the navigation, as a service it generates the HTML for the desktop/mobile navigation, as a controller it handles the keyboard events to open/close/toggle child menu and move the focus of the current menu item
Script link
q4.nav.1.0.0.min.js
Source file
q4.nav.js, line 437

Options

menuItemClassSelected string
This class gets applied to the menu item that represents the current page
Default value
selected
menuItemClassExpanded string
This class gets applied to the parent menu items of the selected menu item
Default value
expanded
destWrapper string
A selector to grab the root page element
Default value
form > .layout
destContent string
A selector to grab the page content element
Default value
.layout_inner
breakpoint number
Breakpoint used to determine current state, typical breakpoints are 1024px (tablet) and 768px (phone)
Default value
1024
animationTime number
Animation duration for css transitions (ms)
Default value
500
includeRootElement boolean
A flag to determine whether or not to include the 'Overview' page in the nav
Default value
true
maxDepth number
Determines max depth of nav children. Ex. 1 will only show root elements NOTE: "NavigationDepth" offers the same functionality in the "Main Navigation" module. In the case of multiple navigations, this option may be used to further limit the navigation depth of this nav.
Default value
1000
hasDesktopMenu boolean
A flag to control the existance of the menu
Default value
true
destDesktop string
A selector of which the nav will be rendered into
Default value
.nav--desktop
dirDesktop string
Defines how the nav should be displayed: hoz (horizontal), vert (vertical)
Default value
hoz
styleDesktop string
The style of the child menus
Default value
list
iconMenuTop string
The icon used for top-level menu items that have child menus
Default value
q4-icon_chevron-down
iconMenuInner string
The icon used for inner menu items that have child menus
Default value
q4-icon_chevron-right
includeSearchDesktop boolean
An option to include the searchbar or not
Default value
true
searchFormIdDesktop string
A selector used to id desktop search form
Default value
navDesktopSearchForm
destSearchTooltip string
Id of the tooltip that appears when clicking the search button
Default value
#search-tip
searchTooltipLabel string
Tooltip text that appears when clicking the search button
Default value
Search
menuFxDesktop string
The transition effect of opening/closing the menu: pop
Default value
pop
includeChildrenDesktop boolean
If the desktop nav should include child menus
Default value
true
splitDesktop boolean
A flag to indicate whether or not to split the nav in two: header nav for top level links and a secondary nav for IR pages
Default value
false
destDesktopSplit string
A selector for where to put the secondary nav
Default value
.nav--ir--desktop
splitSourceDesktop string
The data source for the secondary nav
Default value
investor relations
dirDesktopSplit string
Defines how the nav should be displayed: hoz (horizontal), vert (vertical)
Default value
hoz
styleDesktopSplit string
The style of the child menus
Default value
list
includeSearchDesktopSecondary boolean
Wether to render search on secondary nav or not
Default value
false
searchDesktopSecondaryIdSuffix string
Default value
Secondary
destSearchTooltipSecondary string
Id of the tooltip that appears when clicking the search button
Default value
#search-tip-secondary
hasMobileMenu boolean
A flag to control the existance of the menu
Default value
true
destMobileToggle string
A selector for the button that toggles the nav
Default value
.nav--mobile--toggle
destMobile string
A selector to be used to wrap the nav
Default value
.nav--mobile
dirMobile string
Defines where to place the nav: right, left
Default value
right
styleMobile string
Defines how the nav should be displayed: expand, panel
Default value
expand
includeSearchMobile boolean
Option to include the searchbar or not
Default value
true
dirSearchMobile string
Option to set where the searchbar will be rendered: top, bottom
Default value
top
searchFormIdMobile string
A selector used to id mobile search form
Default value
navMobileSearchForm
destSearchMobile string
A selector that targets the searchbar
Default value
.nav--mobile--search_container--input
classMobileOpen string
A class applied to the root page element when the nav is opened
Default value
js--mobile
backButtonLabel string
A mustache tempalate for mobile inner menu's previous menu button
Default value
{{{parent.text}}}
menuFxMobile string
The transition effect of opening/closing the menu: pop, slide-down
Default value
pop
screenReaderObstaclesMobile string
A selector for undesired elements that screenreader is able to reach when the mobile menu is open
Default value
iframe[title="recaptcha challenge"], .qassist-descr, .qassist-badge
includechildrenMobile boolean
If the mobile nav should include child menus
Default value
true
splitMobile boolean
A flag to indicate whether or not to split the nav in two: header nav for top level links and a secondary nav for IR pages
Default value
false
destMobileToggleSplit string
A selector for the button that toggles the nav
Default value
.nav--ir--mobile--toggle
destMobileSplit string
A selector for the secondary mobile nav
Default value
.nav--ir--mobile
splitSourceMobile string
The data source for the secondary nav
Default value
investor relations
styleMobileSplit string
The style of the child menus
Default value
expand
classMobileOpenSplit string
Class applied to the root page element when the nav is opened
Default value
js--mobile--ir
beforeExtractData function
Function called before the navigation data has been extracted
Parameters
element Object
Nav Links element
afterExtractData function
Function called after the navigation data has been extracted
Parameters
data Object
The data object
beforeRender function
Function called just before a nav is rendered
Parameters
event Event
The event object
beforeRenderDesktop function
Function called just before the mobile nav is rendered
Parameters
templates Object
An object containing the template strings
beforeRenderMobile function
Function called just before the mobile nav is rendered
Parameters
templates Object
An object containing the template strings
onComplete function
Function called when the nav(s) have finished being created / initialized
animateOpenMobile function
Function called when the mobile nav opens
animateCloseMobile function
Function called when the mobile nav closes
Parameters
end function
A callback function
animateOpenMobileSplit function
Function called when the mobile nav opens
animateCloseMobileSplit function
Function called when the mobile nav closes
Parameters
end function
A callback function