Login With Github

Swiper API: History Navigation

History Navigation Parameters

Parameter Type Default Description
history object/boolean  

Enables history push state where every slide will have its own url. In this parameter you have to specify main slides url like "slides"and specify every slide url using data-history attribute.

Object with history navigation parameters or boolean true to enable with default settings. For example:

var mySwiper = new Swiper('.swiper-container', {
  history: {
    replaceState: true,
  },
});
<!-- will produce "slides/slide1" url in browser history -->
<div class="swiper-slide" data-history="slide1"></div>
{
replaceState boolean false Works in addition to hashnav or history to replace current url state with the new one instead of adding it to history
key string 'slides' Url key for slides
}

0 Comment

temp