Rotator JS JavaScript script

SPONSORED LINKS

    Specification

  • Version:
  • File size: 0 KB
  • File name: rotator-1.0.0.zip
  • Last update:
  • Platform: Windows / Linux / Mac OS / BSD / Solaris
  • Language: JavaScript
  • Price:Other Free / Open So
  • Company: Ariel Flesler (View more)

Rotator JS script description:




Publisher review:
Rotator JS is a small Javascript class that serves as a generic rotator for different kind of collections. Rotator JS is a small Javascript class that serves as a generic rotator for different kind of collections.

Arguments

The Rotator class constructor expects 3 arguments, the last 2 are optional.

Collection

Can be a string, an array or an array-like object( arguments, nodelist, numeric hash ). If it is a string, it will get split by character.

Setter

A function that receives a value, an element of the collection and it's index. It must, either set the value internally or return the new value. The scope (this) will be the element, the arguments are the value and then the index. If it's a string, it means you want to set the value to the attribute of the element with that name. If none is given, then Rotator.defaultSetter is used, which, by default, returns the new value.

Getter:

A function that receives an element of the collection and the index. It must return the desired information from them. The scope (this) will be the element and the first argument, the index. If it's a string, it means you want the attribute of the element with that name. If none is given, then Rotator.defaultGetter is assigned, which, by default, returns the element.

How to use

Once you create an instance (obj) of the class, you can get/set the collection using the method obj.collection(). To rotate the elements, call obj.left() or obj.right(). With each call, the elements will be rotated one position in the direction you specified, and the functions will be called. Note that the collection held by the object won't be the same that you gave it. Yours remains untouched.
Rotator JS is a JavaScript script for Development Tools scripts design by Ariel Flesler. It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.

Operating system:
Windows / Linux / Mac OS / BSD / Solaris

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5