jQuery('#example-1').jstars({
image_path: 'images'  
});
			

Example 1: White

This example illustrates "white" style. As you can see we do not specify any parameters, so style and frequency are set to "white" and "12" automatically.


jQuery('#example-1').jstars({
image_path: 'images'  
});
			

Example 2: Blue

This one illustrates "blue" style.

Also we increased frequency a bit.


jQuery('#example-blue').jstars({
image_path: 'images',
style: 'blue',
frequency: 15
});
			

jQuery('#example-yellow').jstars({
image_path: 'images',
style: 'yellow',
frequency: 20
});
			

Example 3: Yellow

This example illustrates "yellow" style.

And the frequency is set to max value.


jQuery('#example-yellow').jstars({
image_path: 'images',
style: 'yellow',
frequency: 20
});
			

Example 4: Red

This example illustrates "red" style.

The frequency is low here, so the stars shine rarely.


jQuery('#example-red').jstars({
image_path: 'images',
style: 'red',
frequency: 5
});
			

jQuery('#example-green').jstars({
image_path: 'images',
style: 'green'
});
			

Example 5: Green

This example illustrates "green" style.


jQuery('#example-green').jstars({
image_path: 'images',
style: 'green'
});
			

Example 6: Red

Our plugin has tricky mode - to show all stars colors randomly.

You should use style "rand" for this feature.


jQuery('#example-rand').jstars({
image_path: 'images',
style: 'rand'
});
			

Customize the image

You can try to prepare your own asset to display different image instead of stars.

To do that you should make a sprite of 9 images, each next part is differ from previous with 40 degrees angle.

Let's try how candy cane looks... It will be good for Xmas eve :)


jQuery('#example-rand').jstars({
image_path: 'images',
image: 'candy-cane-stars.png',
style: 'white',
width: 34,
height: 34,
delay: 700,
frequency: 5
});
			

适用浏览器:360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. 不支持IE8及以下浏览器。

来源:懒人素材