mooRate 0.9

mooRate is a rating widget. It looks good and provide all the methods and callbacks to work in an ajax environment. There are many different rating widgets available, all using different techniques. This one happens to be my own flavor.



Details

Author
Olivier Refalo
Current version
0.9
GitHub
orefalo/mooRate
Downloads
2368
Category
Interface
Tags
Report
GitHub Issues

Releases


Dependencies

  • _self_/_current_: core/1.2.4:'*'

How to use

CSS code:

HTML code:

0%
</p>
<p>
<div class="moorate_container" >
    <div id="myrating2" class="moorate" title="Rate This!">
        <span class="curr" title="0" style="width:0;"></span>
    </div>
    <div class="mooratelabel">0%</div>
</div>
</p>
<p>
<div class="moorate_container" >
    <div id="myrating3" class="moorate" title="Rate This!">
        <span class="curr" title="0" style="width:0;"></span>
    </div>
    <div class="mooratelabel">0%</div>
</div>
</p>

JS sample:

var rating = new MooRate($$('.moorate'));

rating.setDefaultRate(document.id('myrating1'), "27%");
rating.setDefaultRate(document.id('myrating2'), "5%");
rating.setDefaultRate(document.id('myrating3'), "100%");

var eventHandler = function(target, value) {alert('you picked:'+value+' from element '+target.id)};

document.id('myrating1').addEvent('rated', eventHandler);
document.id('myrating2').addEvent('rated', eventHandler);
document.id('myrating3').addEvent('rated', eventHandler);

Docs

Events:

rated(widget, value): 
    Fires when the user rates.

Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus