jQuery鼠标跟随星星特效插件 -JS/jQuery代码 -演示与下载 -时代Java

jQuery鼠标跟随星星特效插件 A jQuery "Magic" animation plugin


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
});
				
下载代码说明
X关闭

jQuery实现鼠标跟随星星特效源码

本特效源码是一款基于的jQuery插件jquery-stars可以制作鼠标跟随星星特效的代码。你可以自定义跟随鼠标移动的星星的数量,颜色,范围等,也可以使用自定义的图片来代替星星。本代码适用浏览器:搜狗、360、FireFox、Chrome、Safari、Opera、傲游、世界之窗,不支持IE8及以下浏览器。有兴趣的朋友们可以来下载试试吧。本段代码兼容目前最新的各类主流浏览器,是一款非常优秀的特