Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Learn More

The page scrolls to the top and the page when animation ends for swiper.js plugin

  • 2 отговора
  • 1 има този проблем
  • 71 изгледи
  • Последен отговор от gscott523

more options

I have implemented multiple swiper carousels on one page. It seems that only in firefox, the page scrolls to the top and the page almost looks like its doing a post back (developer tools clear making it difficult to select the swiper.js so that I can set break points – Almost mirrors the behavior of a page postback but i know its not). The page is http://accqa.lazydays.com . Any help would be much appreciated. I'm not sure if this is a swiper issue or a firefox one, but if anyone could help, I would be obliged. When navigating to the example link, Scroll down. You'll see the once the banner finishes rotating the screen will instantly go to the top. I'm pretty sure this is not an issue with the plugin, but checking here just in case.

I have implemented multiple swiper carousels on one page. It seems that only in firefox, the page scrolls to the top and the page almost looks like its doing a post back (developer tools clear making it difficult to select the swiper.js so that I can set break points – Almost mirrors the behavior of a page postback but i know its not). The page is http://accqa.lazydays.com . Any help would be much appreciated. I'm not sure if this is a swiper issue or a firefox one, but if anyone could help, I would be obliged. When navigating to the example link, Scroll down. You'll see the once the banner finishes rotating the screen will instantly go to the top. I'm pretty sure this is not an issue with the plugin, but checking here just in case.

Избрано решение

I notice a hash appear at the end of the URL:

http://accqa.lazydays.com/#

???

Oh, I think I found it: you are setting the hashnav parameter to true in your API call. But you aren't supplying the data-hash parameter, which may be causing the use of # alone in this function:

setHash: function () { if (!s.hashnav.initialized || !s.params.hashnav) return; document.location.hash = s.slides.eq(s.activeIndex).attr('data-hash') || ''; }

Or maybe the problem is somewhere else. There are a ton of source files.

See: http://idangero.us/swiper/api/#hash

Прочетете този отговор в контекста 👍 0

Всички отговори (2)

more options

Избрано решение

I notice a hash appear at the end of the URL:

http://accqa.lazydays.com/#

???

Oh, I think I found it: you are setting the hashnav parameter to true in your API call. But you aren't supplying the data-hash parameter, which may be causing the use of # alone in this function:

setHash: function () { if (!s.hashnav.initialized || !s.params.hashnav) return; document.location.hash = s.slides.eq(s.activeIndex).attr('data-hash') || ''; }

Or maybe the problem is somewhere else. There are a ton of source files.

See: http://idangero.us/swiper/api/#hash

more options

You Rock. Thanks so much!