Coder Social home page Coder Social logo

jq-widget-rating's Introduction

Simple jQuery Rating Plugin

This is a quick and simple jQuery Rating plugin. Made for collect a value from 1 to X, in a nice view with Active and Inactive icons.

Example of 1-5 rating

Requirements

  • jQuery

Installation

  • Include the rating.js and rating.css file to your project.
  • If you want to use the default star icons, you should also include the folder img to the same path where your rating.js is. (if you want to change the icons, you can provide options to the plugin iconSrcActive and iconSrcInactive)

Configuration

  • iconSize : Specify as a string, the desired size for your icons (default: 35px)
  • iconSrcActive : Icon image for active state
  • iconSrcInactive : Icon image for inactive state
  • iconPadding : The space between icons (default: 5px (Define as a integer value))
  • maxValue : Maximum value for rating (default: 5)
  • value : Current value for rating (it also looks for attribute value, so, if your target element is a input with a number, the default value will be the input value)

Note: Icon resource for Active and Inactive are defined as cover in a background image.

Example

<input type="number" class="my-awesome-rating" value="2" />

<script>

$(document).ready(function(){

    $('.my-awesome-rating').rating({
        maxValue: 10,
        iconSize: '70px',
        iconSrcActive: 'myImages/active-star.svg',
        iconSrcInactive: 'myImages/inactive-star.svg,
        iconPadding: 10
    });

});

</script>

jq-widget-rating's People

Contributors

rodrigotbrun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.