jQuery+CSS3实现404背景动画特效【转】
程序员文章站
2022-06-17 21:37:01
jQuery+CSS3实现404背景动画特效 效果: http://hovertree.com/texiao/jquery/74/ 源码下载: http://hovertree.com/h/bjaf/ko0gcgw5.htm 效果图如下: 代码如下: 文章来自: "https://www.cnblo ......
jquery+css3实现404背景动画特效
效果:
源码下载:
效果图如下:
代码如下:
<!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>jquery+css3实现404背景动画特效 - 何问起</title><base target="_blank" /> <link href="http://hovertree.com/texiao/jquery/74/css/404.css" rel="stylesheet" type="text/css" /> <script src="http://down.hovertree.com/jquery/jquery-1.7.2.min.js"></script> <script type="text/javascript"> $(function() { var h = $(window).height(); $('body').height(h); $('.mianbox').height(h); centerwindow(".tipinfo"); }); //2.将盒子方法放入这个方,方便法统一调用 function centerwindow(a) { center(a); //自适应窗口 $(window).bind('scroll resize', function() { center(a); }); } //1.居中方法,传入需要剧中的标签 function center(a) { var wwidth = $(window).width(); var wheight = $(window).height(); var boxwidth = $(a).width(); var boxheight = $(a).height(); var scrolltop = $(window).scrolltop(); var scrollleft = $(window).scrollleft(); var top = scrolltop + (wheight - boxheight) / 2; var left = scrollleft + (wwidth - boxwidth) / 2; $(a).css({ "top": top, "left": left }); } </script> </head> <body> <div class="mianbox"> <img src="http://hovertree.com/texiao/jquery/74/images/yun0.png" alt="" class="yun yun0" /> <img src="http://hovertree.com/texiao/jquery/74/images/yun1.png" alt="" class="yun yun1" /> <img src="http://hovertree.com/texiao/jquery/74/images/yun2.png" alt="" class="yun yun2" /> <img src="http://hovertree.com/texiao/jquery/74/images/bird.png" alt="鸟" class="bird" /> <img src="http://hovertree.com/texiao/jquery/74/images/san.png" alt="何问起" class="san" /> <div class="tipinfo"> <div class="in"> <div class="textthis"> <h2>页面不存在</h2> <p><span>页面将自动<a id="href" href="http://hovertree.com/h/bjaf/tiaosan.htm">跳转</a></span><span>等待<b id="wait">60</b>秒</span></p> <script type="text/javascript"> (function() { var wait = document.getelementbyid('wait'), href = document.getelementbyid('href').href; var interval = setinterval(function() { var time = --wait.innerhtml; if (time <= 0) { location.href = href; clearinterval(interval); } ; }, 1000); })(); </script> </div> </div> </div> </div> <div style="text-align:center;margin:50px 0; font:normal 14px/24px 'microsoft yahei';"> <p>适用浏览器:360、firefox、chrome、safari、opera、傲游、搜狗、世界之窗. 不支持ie8及以下浏览器。</p> <p>来源:<a href="http://hovertree.com/" target="_blank">何问起</a> <a href="http://hovertree.com/texiao/">特效</a> <a href="http://hovertree.com/h/bjaf/tiaosan.htm">原文</a></p> </div> </body> </html>
文章来自: