question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible to use flex instead of absolute positioning on the swiper?

See original GitHub issue

Thanks for the great work! Just wondering if it’s possible to use flex layout on the Swiper instead of absolute so it’s easier to config it’s layout?

I have’t dive deep into the src code to learn if position: absolute is critical. If it’s not I’m willing to help 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
webraptorcommented, May 25, 2017

What would be better would be to change the sizing of the cards relatively to parent or hardcoded via props. Right now sizing is done based on device size.

1reaction
webraptorcommented, May 25, 2017

Why switch to flex when you can wrap your swiper in a <View> with position: ‘relative’ and then the swiper will be configured based on the parent? With position absolute and zIndex it is really easy to style and animate the cards on top of each other, create a stack effect and so on. With flex you won’t be able to stack them on top of each other and it will complicate everything.

@mschiele not sure if you fixed your problem yet, but if you use flex for the map and a view on the bottom area of the screen, have the view with position: ‘relative’, then the swiper will be positioned absolutely within the view (not the entire screen), therefor, it will not flow on top of your map.

Good read on zIndex https://www.smashingmagazine.com/2009/09/the-z-index-css-property-a-comprehensive-look/ Absolute & relative positioning https://css-tricks.com/absolute-positioning-inside-relative-positioning/

Once you understand the concepts behind the 3, you’ll be able to easily play around without any issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does 'position: absolute' conflict with Flexbox? - Stack Overflow
No, absolutely positioning does not conflict with flex containers. Making an element be a flex container only affects its inner layout model ...
Read more >
Flexbox and absolute positioning - CSS-Tricks
Chen Hui Jing notes that when you absolutely position a flex item, it's no longer part of the flex layout. Except… it kinda...
Read more >
CSS Positioning Classes - Quasar Framework
The list of CSS classes supplied by Quasar to simplify the positioning of a DOM element.
Read more >
How to Build a Responsive Slider With Swiper.js - Web Design
In this tutorial, we'll build a unique page layout by taking advantage of Swiper.js, one of the most popular JavaScript sliders available ...
Read more >
Team:FAFU-CHINA/CSS/SWIPER-CSS - iGEM 2021
Swiper 4.5.3 * Most modern mobile touch slider and framework with hardware accelerated ... .swiper-slide-shadow-top{position:absolute;left:0;top:0 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found