It's a random action utility.
- Standalone(CDN) -> https://cdn.jsdelivr.net/gh/yama-dev/js-random-module@v0.4.3/dist/js-random-module.js
# install npm.
npm install --save-dev @yama-dev/js-random-module
// import.
import RANDOM_MODULE from '@yama-dev/js-random-module';
<div class="js-bg">
<div class="js-bg-item">test-1</div>
<div class="js-bg-item">test-2</div>
<div class="js-bg-item">test-3</div>
<div class="js-bg-item">test-4</div>
<div class="js-bg-item">test-5</div>
</div>
<script src="./js-random-module.js"></script>
<script>
var RAM = new RANDOM_MODULE('.js-bg-item',{
elemWrap: '.js-bg',
durationX2: 3000,
interval: 1000,
intervalDeflection: 500,
addClassName: ['is-active','is-current'],
autoStart: true,
preStartCount: 1,
positionRandom: true,
repeat: true
});
</script>
none
For Developer
- Fork it ( https://github.com/yama-dev/js-random-module/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
Install node modules.
$ npm install
Run npm script 'develop'
$ npm run develop
Run npm script 'production'
$ npm run production