1、引入以下的js和css文件
<script src="jquery.min.js"></script> <script src="jquery.lettering.js"></script>
2、在head标签中加入以下js代码
<script>
// DOM Ready
$(function() {
$("#poster h1, #poster p").lettering();
$("#poster p span").each(function() {
$(this).css({
top: -(Math.floor(Math.random() * 1001) + 1500),
left: Math.floor(Math.random() * 1001) - 500,
});
});
setTimeout(function() {
$('html').addClass("step-one");
},
1000);
setTimeout(function() {
$('html').addClass("step-two");
},
3000);
});
</script>
3、在body标签中加入以下格式的html代码
<div id="poster"> <h1> jquery插件库 </h1> <p> Coming 2011 </p> </div>
3、有关的css样式也很重要,请参照网盘下载包中的源码,简洁易懂。