jQuery的出現,使得普通JS腳本遜色了很多,jQuery隨時會帶給我們炫麗而無法想像的效果,今天最火軟件站(原網)再帶給大家一個炫彩的jQuery網頁特效,在本例當中,使用了兩張普通的花朵圖片,但是通過jQuery讓它們變得動感起來,小編給他取名為:百葉展開效果。不管形容的對不對吧,大家一起來學習!
為解決一些網頁特效運行后不能顯示效果(例如:jQuery則需要刷新)問題,特別新增網頁版演示。
點擊查看:網頁特效
運行演示:
<!DOCTYPE html><html><head><title>jquery 花朵綻放動畫 _ 最火軟件站(原網)</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script type="text/javascript" src="/uploads/common/js/jquery-1.7.min.js"></script><style type="text/css">*{margin: 0px;padding: 0px;}#test{width:300px; height: 300px; position: relative; margin: 20px auto 0px;}</style></head><body><div id="test"><img alt="" width="300" height="300" src="/uploads/allimg/1207/wfuyu_r_test1.jpg" /></div><script type="text/javascript">$(function(){var test = $("#test");var html = '';for(var i=0;i<5;i++){html+='<div style="width:60px;height:300px;position:absolute;top:0px;left:'+60*i+'px;background:url(/uploads/allimg/1207/wfuyu_r_test1.jpg) '+-60*i+'px 0px no-repeat;"></div>';}test.prepend(html);test.find("div").eq(0).animate({ "top":"320px"},2000);test.find("div").eq(1).animate({ "top":"320px"},2500);test.find("div").eq(2).animate({ "top":"320px"},3000);test.find("div").eq(3).animate({ "top":"320px"},3500);test.find("div").eq(4).animate({ "top":"320px"},4000);test.find("div").eq(0).delay(5000);test.find("div").eq(4).delay(3000);test.find("div").eq(1).delay(5000);test.find("div").eq(3).delay(4000);test.find("div").eq(2).delay(5000);test.find("div").eq(0).animate({ "left":"-320px","top":"0px","width":"300px","height":"300px"},5000);test.find("div").eq(4).animate({ "left":"320px","top":"0px","width":"300px","height":"300px","background-position":"0px 0px"},5000);test.find("div").eq(1).animate({ "left":"-320px","top":"320px","width":"300px","height":"300px","background-position":"0px 0px"},4500);test.find("div").eq(3).animate({ "left":"320px","top":"320px","width":"300px","height":"300px","background-position":"0px 0px"},4500);test.find("div").eq(2).animate({ "left":"0px","top":"320px","width":"300px","height":"300px","background-position":"0px 0px"},4000);test.find("div").eq(0).delay(2000);test.find("div").eq(4).delay(2000);test.find("div").eq(1).delay(2000);test.find("div").eq(3).delay(2000);test.find("div").eq(2).delay(2000);test.find("div").eq(0).animate({ "left":"0px","top":"0px","width":"300px","height":"300px","background-position":"0px 0px"},5000);test.find("div").eq(4).animate({ "left":"0px","top":"0px","width":"300px","height":"300px","background-position":"0px 0px"},5000);test.find("div").eq(1).animate({ "left":"0px","top":"0px","width":"300px","height":"300px","background-position":"0px 0px"},4500);test.find("div").eq(3).animate({ "left":"0px","top":"0px","width":"300px","height":"300px","background-position":"0px 0px"},4500);test.find("div").eq(2).animate({ "left":"0px","top":"0px","width":"300px","height":"300px","background-position":"0px 0px"},4000);test.find("div").eq(0).delay(2000);test.find("div").eq(4).delay(2000);test.find("div").eq(1).delay(2000);test.find("div").eq(3).delay(2000);test.find("div").eq(2).delay(2000);test.find("div").eq(0).animate({ "left":"0px","top":"300px","width":"60px","height":"300px","background-position":"0px 0px"},5000,function(){test.find("img").css({"position":"absolute","left":"0px","top":"0px","z-index":"999"}); test.find("div").css({"background":"url(/uploads/allimg/1207/wfuyu_r_test3.jpg) no-repeat"});});test.find("div").eq(4).animate({ "left":"240px","top":"300px","width":"60px","height":"300px","background-position":"-240px 0px"},5000);test.find("div").eq(1).animate({ "left":"60px","top":"200px","width":"60px","height":"300px","background-position":"-60px 0px"},4500);test.find("div").eq(3).animate({ "left":"180px","top":"200px","width":"60px","height":"300px","background-position":"-180px 0px"},4500);test.find("div").eq(2).animate({ "left":"120px","top":"300px","width":"60px","height":"300px","background-position":"-120px 0px"},4000);});</script></body></html><div style="text-align:center;margin:30px 0 0 0;"><hr style="color:#999;height:1px;">如不能顯示效果,請按Ctrl+F5刷新本頁,更多網頁代碼:<a href='http://www.vxbq.cn/' target='_blank'>http://www.vxbq.cn/</a></div>提示:可修改后代碼再運行!
上一篇 合并css和js文件 加快網站瀏覽速度
下一篇 如何選擇免費虛擬主機及其五點注意事項
程序員人生,我編程,我富裕,記住wfuyu網,php教程,php學習,php手冊,CMS模版制作
聲明:本站大部分內容是作者原創,少部分收集于互聯網供大家一起學習,原版權很多不明,如有侵權請聯系本站,謝謝!
粵ICP備14040726號-1?? 2015-2020 程序員人生 版權所有