memoryroll
v1.4.0
Published
Smart sequence loop starting from a random number
Downloads
4
Maintainers
Readme
jQuery MemoryRoll Plugin
Smart sequence loop starting from a random number.
Description
This is a little jQuery plugin which when first called generates a random number in the given range, saves it in the localStorage with the name given and returns the value generated. Every subsequent call the plugin reads the saved number and returns the next one in the range. After doing this, the plugin saves the new value. If the number in the localStorage is the upper range limit it loops around and returns the first number in the range.
Demo
memoryroll.mev.bg
Getting Started
You can download the plugin as an archive.
Or you can grab it by using npm:
npm install memoryroll
Or you can grab it by using Bower:
bower install memoryroll
Installation
Include the script after the jQuery library (unless you package scripts otherwise):
<script src="/path/to/memoryroll.min.js"></script>
Usage
var number = $.memoryroll({
name : 'demo', // required string
rangeFrom : 1, // required number
rangeTo : 10 // required number
});
Browsers compatibility
- Apple Safari
- Google Chrome
- Microsoft Internet Explorer 9+
- Mozilla Firefox
- Opera
Dependencies
License
Copyright © 2017 Martin Metodiev. Licensed under the MIT license. See here for more details.