swiper icon indicating copy to clipboard operation
swiper copied to clipboard

Option to easily hide a slide without removing it

Open ReneReiterer opened this issue 1 year ago • 4 comments

Clear and concise description of the problem

It would be really nice, if there was an option to hide a slide without having to remove it. For example so that you could have different images for mobile/desktop. Currently if you just set the hidden slides to display: none it will not work.

Suggested solution

Maybe just a simple class that if a slide has it, its ignored by the swiper

Alternative

No response

Additional context

No response

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this feature?

  • [ ] I'm willing to open a PR

ReneReiterer avatar Dec 03 '24 07:12 ReneReiterer

can this issue be assigned to me?

Prachiii1301 avatar Jan 04 '25 13:01 Prachiii1301

It would be perfect if you could hide a slide and the carousel would close the empty space with an animation.

bluelemonade avatar Jan 12 '25 16:01 bluelemonade

this is something i needed. my app uses template driven forms in angular and data is populated by fields that are in the dom - so removing fields from the dom ruined the form functionality. if it was possible to hide certain slides from view and have them ignored by swiper - this would be perfect.

for now ive reverted from using the swiper-slide elements and am using standard html css - removing the .swiper-slide class and adding .hidden (using tailwind) when i don't want the slide recognised as an actual slide.

jtumain avatar Apr 07 '25 09:04 jtumain

do you resize the slide to dissappear the slide ymoothly?

bluelemonade avatar Apr 07 '25 10:04 bluelemonade