Socket
Socket
Sign inDemoInstall

memoryroll

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memoryroll

Smart sequence loop starting from a random number


Version published
Weekly downloads
8
decreased by-65.22%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 16 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc