nolimits4web / swiper

Most modern mobile touch slider with hardware accelerated transitions
https://swiperjs.com
MIT License
39.59k stars 9.75k forks source link

width and height using percentage #896

Closed mnifakram closed 9 years ago

mnifakram commented 10 years ago

Hey I want to make something that mix between responsive and partial, I set the swiper-container{ width:100%; height:100%} and the swiper-slide{width:90%; height:100%} but in the output I get the swiper-slide width 100% (the same as the container) how I can correct this. Check the demo http://jsfiddle.net/fnhb137d/

nolimits4web commented 10 years ago

you can't set slide's width in percents, because as you should know it is calculating from the width of parent, and slide's parent is wrapper which is much wider than swiper-container. Also slidesPerView:'auto' should be enabled

nolimits4web commented 9 years ago

Closing as no further discussion

zapatoche commented 8 years ago

But if we know the width of the parent (on page load) can't we define the width of the slider-wrapper depending one the number of item, then set their width in % of the slider-wrapper width? I'm asking because I have a project with "fluid" typography, and when I increase the font size on the body, the slider breaks in IE10/11 (because the swipes width is in pixel).

lock[bot] commented 6 years ago

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.