-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): rewind on swipes (#5422)
* feat(core): `rewindOnSwipe` * fix(core): remove rewindSwipe option * fix(core): revert space * fix(core): remove console log * fix(core): rewind on swipe * feat(core): rewind on swipe Co-authored-by: Vladimir Kharlampidi <[email protected]>
- Loading branch information
1 parent
0567641
commit 1a2f83b
Showing
2 changed files
with
89 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,69 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Swiper Playground</title> | ||
<meta name="viewport" content="width=device-width" /> | ||
</head> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Swiper Playground</title> | ||
<meta name="viewport" content="width=device-width" /> | ||
</head> | ||
<body> | ||
<section class="swiper"> | ||
<div class="swiper-pagination"></div> | ||
<div class="swiper-slide">Slide 1</div> | ||
<div class="swiper-slide">Slide 2</div> | ||
<div class="swiper-slide">Slide 3</div> | ||
<div class="swiper-slide">Slide 4</div> | ||
<div class="swiper-slide">Slide 5</div> | ||
<div class="swiper-slide">Slide 6</div> | ||
<div class="swiper-slide">Slide 7</div> | ||
<div class="swiper-slide">Slide 8</div> | ||
<div class="swiper-slide">Slide 9</div> | ||
<div class="swiper-slide">Slide 10</div> | ||
</section> | ||
<style> | ||
body, | ||
html { | ||
padding: 0; | ||
margin: 0; | ||
position: relative; | ||
height: 100%; | ||
} | ||
|
||
<body> | ||
<section class="swiper"> | ||
<div class="swiper-pagination"></div> | ||
<div class="swiper-slide">Slide 1</div> | ||
<div class="swiper-slide">Slide 2</div> | ||
<div class="swiper-slide">Slide 3</div> | ||
<div class="swiper-slide">Slide 4</div> | ||
<div class="swiper-slide">Slide 5</div> | ||
<div class="swiper-slide">Slide 6</div> | ||
<div class="swiper-slide">Slide 7</div> | ||
<div class="swiper-slide">Slide 8</div> | ||
<div class="swiper-slide">Slide 9</div> | ||
<div class="swiper-slide">Slide 10</div> | ||
</section> | ||
<style> | ||
body, | ||
html { | ||
padding: 0; | ||
margin: 0; | ||
position: relative; | ||
height: 100%; | ||
} | ||
.swiper { | ||
width: 100%; | ||
height: 300px; | ||
margin: 50px auto; | ||
} | ||
|
||
.swiper { | ||
width: 100%; | ||
height: 300px; | ||
margin: 50px auto; | ||
} | ||
.swiper-slide { | ||
background: #f1f1f1; | ||
color: #000; | ||
text-align: center; | ||
line-height: 300px; | ||
} | ||
</style> | ||
<script type="module"> | ||
// eslint-disable-next-line | ||
import 'swiper/swiper-bundle.css'; | ||
|
||
.swiper-slide { | ||
background: #f1f1f1; | ||
color: #000; | ||
text-align: center; | ||
line-height: 300px; | ||
} | ||
</style> | ||
<script type="module"> | ||
// eslint-disable-next-line | ||
import 'swiper/swiper-bundle.css'; | ||
|
||
// eslint-disable-next-line | ||
import Swiper from 'swiper/swiper-bundle.esm.js'; | ||
|
||
// eslint-disable-next-line | ||
window.swiper = new Swiper({ | ||
el: '.swiper', | ||
createElements: true, | ||
speed: 300, | ||
cssMode: true, | ||
rewind: true, | ||
slidesPerView: 1, | ||
navigation: true, | ||
pagination: { | ||
el: '.swiper-pagination', | ||
dynamicBullets: true, | ||
// dynamicMainBullets: 3, | ||
}, | ||
}); | ||
|
||
</script> | ||
</body> | ||
// eslint-disable-next-line | ||
import Swiper from 'swiper/swiper-bundle.esm.js'; | ||
|
||
// eslint-disable-next-line | ||
window.swiper = new Swiper({ | ||
el: '.swiper', | ||
createElements: true, | ||
speed: 300, | ||
// cssMode: true, | ||
rewind: true, | ||
slidesPerView: 1, | ||
navigation: true, | ||
pagination: { | ||
el: '.swiper-pagination', | ||
dynamicBullets: true, | ||
// dynamicMainBullets: 3, | ||
}, | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters