-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use side wheel to move conveyer (#15)
* feat: add useSideWheel option * fix: handle mixed horizontal with vertical scrolling wheel * fix: modify side wheel scale * skip: apply review * fix: unify change condition of isReachEnd
- Loading branch information
Showing
11 changed files
with
203 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<style> | ||
body { | ||
background: #F0F3FB; | ||
margin-left: 0; | ||
margin-right: 0; | ||
} | ||
|
||
.items { | ||
position: relative; | ||
overflow: scroll hidden; | ||
width: 100%; | ||
white-space: nowrap; | ||
overscroll-behavior: none; | ||
user-select: none; | ||
} | ||
.container { | ||
display: block; | ||
position: relative; | ||
width: 100%; | ||
} | ||
|
||
.item { | ||
display: inline-block; | ||
overflow: hidden; | ||
margin: 18px 12px 30px 0; | ||
width: 271px; | ||
height: 244px; | ||
line-height: 244px; | ||
text-align: center; | ||
font-weight: bold; | ||
font-size: 40px; | ||
border-radius: 3px; | ||
background-color: #fff; | ||
-webkit-box-shadow: 0 2px 2px 0 rgb(0 0 0 / 4%), 0 0 2px 0 rgb(0 0 0 / 15%); | ||
box-shadow: 0 2px 2px 0 rgb(0 0 0 / 4%), 0 0 2px 0 rgb(0 0 0 / 15%); | ||
} | ||
</style> | ||
|
||
<body> | ||
<div class="items"> | ||
<div class="item">1</div> | ||
<div class="item">2</div> | ||
<div class="nested item"> | ||
<div class="item">3.1</div> | ||
<div class="item">3.2</div> | ||
<div class="item">3.3</div> | ||
<div class="item">3.4</div> | ||
<div class="item">3.5</div> | ||
</div> | ||
<div class="item">4</div> | ||
<div class="item">5</div> | ||
<div class="item">6</div> | ||
<div class="item">7</div> | ||
<div class="item">8</div> | ||
<div class="item">9</div> | ||
<div class="item">10</div> | ||
<div class="item">11</div> | ||
<div class="item">12</div> | ||
</div> | ||
</body> | ||
<script src="../../dist/conveyer.js"></script> | ||
<script> | ||
const conveyer = new Conveyer(".items", { | ||
preventClickOnDrag: true, | ||
useSideWheel: true, | ||
}); | ||
conveyer.init(); | ||
const nested = new Conveyer(".nested", { | ||
preventClickOnDrag: true, | ||
nested: true, | ||
useSideWheel: true, | ||
}); | ||
nested.init(); | ||
</script> |
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
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
Oops, something went wrong.