Peter Peterson![]()
A multi-star rating widget. By default, it will display 5 stars, but can be configured to display any number. If the initial value is a fraction, it will display this.
Clicking on a star will fire a ratingClick event which contains the chosen rating. Optionally, the application could listen to the ratingChange event. In addition to updating the widget, the srcNode provided will be updated with the selected rating.
Widget can be configured to be displayed inline or as a block. With or without a "Clear Rating" button, and the tooltips for the widget may also be configured. Two skins are also available for use "default" and "small", but a good F2E could also make their own custom skin if desired.
Add a target node with a rating:
<span id="myWidget">2.5</span>
or
<input type="text" name="myRatings" id="myRatings" value="3.7">
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2011.10.20-23-28'
}).use('gallery-ratings', function(Y) {
var ratings = new Y.Ratings({ srcNode: "#myWidget" }, inline: true, skin: "small" });
var ratings = new Y.Ratings({ srcNode: "#myRatings" }, inline: true, skin: "small" });
});| Subject | Author | Date |
|---|---|---|
| Progressive enhancement | Matt Parker | 04/14/10 |
| Re: Progressive enhancement | Peter Peterson | 04/15/10 |
| Re: Progressive enhancement | Marc | 05/4/10 |
| Re: Progressive enhancement | Daniel | 10/17/11 |
| Re: Progressive enhancement | Daniel | 10/17/11 |
| Post data of stars rating | Daniel | 10/18/11 |
| Re: Post data of stars rating | Daniel | 10/19/11 |
| Re: Post data of stars rating | Peter Peterson | 10/19/11 |
| Re: Progressive enhancement | Peter Peterson | 10/19/11 |
| Re: Progressive enhancement | Marc | 10/19/11 |
© 2006-2011 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info