Skip to content

Commit 66d322f

Browse files
committed
feat: stop autoplay when hover
1 parent 2953220 commit 66d322f

File tree

5 files changed

+81
-20
lines changed

5 files changed

+81
-20
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Slider:
110110
| touch | Boolean | true | Enable touch slide |
111111
| animation | 'normal', 'fade' | 'normal' | Change animation |
112112
| autoplay | Boolean | true | Autoplay |
113+
| stopOnHover | Boolean | false | Stop autoplay when hover |
113114
| interval | Number | 3000 | Delay of autoplay ( autoplay option should be true ) |
114115
| speed | Number | 500 | Speed(ms) of animation |
115116
| indicators | 'center', 'left', 'right', false | 'center' | Show indicators on option position or hide indicators |

Diff for: demo/index.html

+21
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,27 @@
7070
]),
7171
3000,
7272
)
73+
setTimeout(
74+
() =>
75+
(this.list = [
76+
{
77+
backgroundColor: '#3f51b5',
78+
width: '100%',
79+
height: '100%',
80+
},
81+
{
82+
backgroundColor: '#eee',
83+
width: '100%',
84+
height: '100%',
85+
},
86+
{
87+
backgroundColor: '#f44336',
88+
width: '100%',
89+
height: '100%',
90+
},
91+
]),
92+
5000,
93+
)
7394
},
7495
})
7596
</script>

0 commit comments

Comments
 (0)