ocean-bg-slider
v1.0.1
Published
背景滑动效果
Downloads
2
Readme
ocean-bg-slider
The command line app for ocean-bg-slider
Install
$ npm i ocean-bg-slider
Features
- 翻书特效
Usage
1、js中导入
import 'ocean-bg-slider'
2、dom结构
<div class="example bg-slider"></div>
<div class="example bg-slider1"></div>
按常规设置自己的背景,比如:
.example {
width: 100%;
height: 100px;
background: url('./images/bg.jpg');
background-size: 100%;
}
3、script
<script>
// 左滑
$('.bg-slider').bgSlider({
name: 'bgSlider', // 可任意给一个名称,用于
target: '.bg-slider', // 需要滚动背景的类
time: '15s', // 一次动画时长
direction: '-' // '-' or '+'
})
// 右滑
$('.bg-slider1').bgSlider({
name: 'bgSlider1',
target: '.bg-slider1',
time: '35s',
direction: '+'
})
</script>