My swiper-slide works well at first and I can scroll it horizontally, but after I used php to display my product details from my database and the swiper-slide now displays vertically instead of horizontally. And that is my problem - I want to display my swiper slide horizontally.
My swiper-slide works well at first and I can scroll it horizontally, but after I used php to display my product details from my database and the swiper-slide now displays vertically instead of horizontally. And that is my problem - I want to display my swiper slide horizontally.
Share Improve this question edited Sep 25, 2018 at 8:51 curveball 4,50515 gold badges45 silver badges52 bronze badges asked Sep 25, 2018 at 1:59 Mitch Frankein Mitch Frankein 311 silver badge3 bronze badges2 Answers
Reset to default 4Firstly, I was also facing the same error then I figure out that
"<link rel="stylesheet" href="https://unpkg./swiper/swiper-bundle.min.css" ">
the above link was not included in head of the HTML..... Please visit swiper website for the link. I hope it will be helpful.
By default swiper sets "direction" to "horizontal"
make sure you have set options correctly, try the following code
var swiper = new Swiper('.your-swiper-container', { 'direction': 'horizontal' }); //Using Method on page load, this will set the direction to horizontal on page load and after slider initialization swiper.params.direction = "horizontal"; //for horizontal swiper.update();
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745258797a4619114.html
评论列表(0条)