jQuery网页飘雪代码制作网页飘雪背景动画代码



131 521 174



特效描述:飘雪 网页飘雪代码 网页飘雪 背景动画,

代码结构

1. 引入JS

<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src='js/snowfall.jquery.js'></script>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src='js/snowfall.jquery.js'></script>

2. HTML代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>下雪动画</title>
<style type="text/css">
html,body{padding:0;margin:0;}
.darkBg{background:#2d0f0f url(images/smashing.jpg) top center no-repeat;}
.lightBg{background:url(images/snow.jpg) #b1dde0 top center no-repeat;}
.collectonme{margin:120px auto;background:red;width:50%;text-align:center;font-size:1.2em;color:#fff;}
</style>
</head>
<body class="darkBg">
<input type="button" id="clear" value="Click to clear"/>
<input type="button" id="round" value="Rounded"/>
<input type="button" id="shadows" value="Shadows"/>
<input type="button" id="roundshadows" value="Rounded Shadows"/>
<input type="button" id="collection" value="Snow Collection"/>
<input type="button" id="deviceorientation" value="Deviceorientation"/>
<div class="collectonme">
	<p>Collect on meeeeee!!!</p>
</div>
<div class="collectonme">
	<p>Collect on meeeeee!!!</p>
</div>
<div class="collectonme">
	<p>Collect on meeeeee!!!</p>
</div>
<script type='text/javascript'> 	
$(document).ready(function(){
	$(document).snowfall();
	$("#clear").click(function(){
		$(document).snowfall('clear'); // How you clear
	});
	$("#round").click(function(){
		document.body.className  = "darkBg";
		$('.collectonme').hide();
		$(document).snowfall('clear');
		$(document).snowfall({round : true, minSize: 5, maxSize:8}); // add rounded
	});
	$("#shadows").click(function(){
		document.body.className  = "lightBg";
		$('.collectonme').hide();
		$(document).snowfall('clear');
		$(document).snowfall({shadow : true, flakeCount:200}); // add shadows
	});
	$("#roundshadows").click(function(){
		document.body.className  = "lightBg";
		$('.collectonme').hide();
		$(document).snowfall('clear');
		$(document).snowfall({shadow : true, round : true,  minSize: 5, maxSize:8}); // add shadows
	});
	$("#collection").click(function(){
		$(document).snowfall('clear');
		document.body.className  = "darkBg";
		$('.collectonme').show();
		$(document).snowfall({collection : '.collectonme', flakeCount : 250});
	});
	$("#deviceorientation").click(function(){
		$(document).snowfall('clear');
		$('.collectonme').hide();
		document.body.className  = "darkBg";
		$(document).snowfall({deviceorientation : true, round : true, minSize: 5, maxSize:8});
	});
});
</script>	
</body>
</html>



用户评论
大牛,别默默的看了,快登录帮我点评一下吧!:)      登录 | 注册


热门标签: 滚动切换 滚动条切换 滑动选项卡 滑动切换 选项卡切换 选项卡 切换 tab切换 页面切换 选项卡插件 切换插件 滑动手风琴 滑动星星打分 切换按钮 表单 表单美化 表单插件 表单美化插件 其他 背景切换 大图切换 雪花 按钮控制

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

jQuery/js讨论群
群号:642649996
Css3+Html5讨论群
群号:322131262

加群请备注:从官网了解到