Swiper: remove slides from dom to save memory

Created on 10 Mar 2015  路  16Comments  路  Source: nolimits4web/swiper

I am using swiper v.3 with a really big slider (100 + slides/images). I am wondering if there is a way to remove unused slides / images from the dom to save memory (say keeping only 10 of them loaded at a time)
Thank you

Most helpful comment

Virtual Slides would make this plugin the No. 1 choice. Lack of the "virtual slides" it is the only thing that stops me from using this plugin. Any progress on this?

All 16 comments

Only some custom solution based on heavy usage of callbacks where you may remove and add slides depending on activeIndex. But i have in plans to realize something like Virtual Slides, that will keep in dom only required amount of slides

You can also try to hide content/images in not-active/visible slides and use lazy loader on images

Any progress regarding this issue ?

As far as I can tell this will still require a custom solution. I have been working on something and if I manage to get it working I will post it up.

@mikebonds cool, let us know when you have something working :-)

I am also working on a solution using the callbacks.

+1 _Really_ important for smooth performance on mobile devices.

Lazy Loading doesn't seem to preload a few prev/next images like it should:

initialSlide: 1,
preloadImages: false,
hashnav: true,
lazyLoading: true,
lazyLoadingInPrevNext: true,
lazyLoadingInPrevNextAmount: 10

.. what am I doing wrong?

Also, once the data-src has been replaced with img, I wonder if I browse 300 images, that many will be loaded in memory?

Any progress on this? Swiper has everything I need, but its just slow compared to PhotoSwipe.

Virtual Slides would make this plugin the No. 1 choice. Lack of the "virtual slides" it is the only thing that stops me from using this plugin. Any progress on this?

No plans to implement this at all?

Looks like this will be included in version 4: https://github.com/nolimits4web/Swiper/blob/master/CHANGELOG.md

It is already in v4

@nolimits4web, Is there any api or workaround to remove a slide from the virtual slides. The general mySwiper.removeSlide() doesn't seem to work.
Thanks in advance.
-Satish

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings