Examples
List of modules
-
Ace Editor
Affix
Alert
Audio
Button
Carousel
Char Counter
Color Picker
Data Table
Datepicker
Diagram Builder
Dropdown
Form Builder
Form Validator
I/O
Image Cropper
Image Viewer
Modal
Node
Pagination
Popover
Progress Bar
Rating
Scheduler
Scrollspy
Sortable Layout
Sortable List
Tabview
Timepicker
Toggler
Toolbar
Tooltip
TreeView
Video
Viewport
Rating
How would you rate Jimmy Stewart's Acting?
<div id="myRating">
<input type="radio" value="1" title="A Large Pink Rabbit" />
<input type="radio" value="2" title="Gives me Vertigo" />
<input type="radio" value="3" title="Headed out the Rear Window" />
<input type="radio" value="4" title="I wanna live again" />
<input type="radio" value="5" title="It's like all wars, I guess" />
<input type="radio" value="6" title="A Lasso Around the Moon" />
<input type="radio" value="7" title="Merry Christmas Building & Loan" />
</div>
<p id="titleBox"></p>
YUI().use(
'aui-rating',
'node',
function(Y) {
var titleBox = Y.one('#titleBox');
var instance, title, stars;
var rating = new Y.StarRating(
{
boundingBox: '#myRating',
disabled: false,
label: "It's OK to be honest:"
}
).render();
rating.on(
'click',
function(event) {
instance = event.target;
title = instance.get('title');
stars = instance.get('value');
if (!title) {
titleBox.set('innerHTML', 'You selected <strong>0 stars</strong> - no rating!');
}
else {
titleBox.set('innerHTML', 'You selected <strong>' + stars + ' stars</strong> - "' + title + '"!');
}
}
);
}
);