Tóth Gábor

Javascript Star Rating System

This is a small star rating system written mainly in Javascipt. Main goal of development was flexibility.

This is why you would love it:

Easily Configurable

  • You can change Star pictures
  • CSS aware, a class is ready to customization
  • Easily embeddable to your CMS, because user’s polls shall return in a hidden input field

Standard Compilant

  • Tested under Opera 9.2, Internet Explorer 6, 7 and Firefox 2.0
  • PHP file contains one class works with both main PHP version (PHP4 and PHP5)
  • Javascript file contains one class too. There is no old, procedural style script, what mess your code up

Package contains:

  • rating.js - contains necessary code
  • Rating.php - PHP class generating html code
  • RatingTest.php - Sample php file
  • Sample Images

Customize Rating System

You must edit Rating.php as described below.

  • var $starCount = 5 - how many stars will be on screen
  • var $picPath = ‘img/’ - where to find star images, you can give relative and absolute path too
  • var $picWidth = 16 - star images width (if you give more then images widths there will be a padding effect)
  • var $scriptPath = ‘rating.js’ - javascript location
  • var $divClass = ‘RatingContainer’ - CSS class of images holder div

Here is Javascript Star Rating System 1.0
[download]

4 Comments so far

  1. Tz May 10th, 2007 5:31

    Nagyon érdekes és hasznos az oldal! Rengeteg információt gyűjtöttem róla a káposzta termesztésével és a permetezéssel kapcsolatban.

    Szombaton disznóölés lesz, remélem jössz! …Ja és hozzál disznót is!

    ui: Visszahozhatnád már a kapámat, amit még ősszel kértél kölcsön tőlem, te sinter!

  2. Tóth Gábor May 10th, 2007 6:23

    Örülök neki, hogy a kertgazdálkodás az életed ilyen szerves része. A kapádért meg gyere át, mert bent van a lovaknál, ugye tudod melyik LÓra gondolok? :D

    Egy rövid történet:
    Valahol régesrégen egy messzi-messzi galaxisban a London külvárosában a fogadóirodák kánaánjában, egy eldugott kis utcában a sarki kocsmával szemben lévő hasonló vendégkörű kis loviban:
    - Jónapot
    - Agyonisten!
    - Szeretnék fogadni a lóra!
    - Jó de melyik lóra?
    - Hát a lóra!
    - Igen, igen, de mégis melyik lóra?
    - Mondom hogy a LÓRA!

  3. Tz May 10th, 2007 7:53

    A LÓRA az tuti befutó!

  4. Tz May 11th, 2007 12:38

    Tartsd meg az aprót, te mocskos állat!

Leave a reply