Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

webstar

0.2.0 • Public • Published

star spm version


Web Star.

INSTALL

$ spm install star --save

USAGE

var Star = require('star');
 
var star = new Star("#demo", {
  length: 5,
  value: 3
});
 
star.on("check", function(value){
  $.ajax("/save/star", {star: value}, function(result){
    if (result === "OK") {
      star.val(value);
    }
  });
});

API

Star(Object element, Object options)

  • element: HTML Element, Selector String.
  • options: Object
    • length: Number
    • value: Number

star.val(Number value)

Set star value.

star.on(String eventName, Function handler)

Binding events.

star.off(String eventName [, Function handler])

Unbinding events.

EVENTS

check

User check star button.

install

npm i webstar

Downloadsweekly downloads

1

version

0.2.0

license

none

repository

githubgithub

last publish

collaborators

  • avatar