MCPcopy
hub / github.com/Splidejs/splide / initNavigation

Function initNavigation

src/js/components/Slides/Slide.ts:146–156  ·  view source on GitHub ↗

* Initializes slides as navigation.

()

Source from the content-addressed store, hash-verified

144 * Initializes slides as navigation.
145 */
146 function initNavigation(): void {
147 const controls = Splide.splides.map( target => {
148 const Slide = target.splide.Components.Slides.getAt( index );
149 return Slide ? Slide.slide.id : '';
150 } ).join( ' ' );
151
152 setAttribute( slide, ARIA_LABEL, format( i18n.slideX, ( isClone ? slideIndex : index ) + 1 ) );
153 setAttribute( slide, ARIA_CONTROLS, controls );
154 setAttribute( slide, ROLE, slideFocus ? 'button' : '' );
155 slideFocus && removeAttribute( slide, ARIA_ROLEDESCRIPTION );
156 }
157
158 /**
159 * If the `updateOnMove` option is `true`, called when the slider starts moving.

Callers

nothing calls this directly

Calls 4

setAttributeFunction · 0.90
formatFunction · 0.90
removeAttributeFunction · 0.90
getAtMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…