<html> <head> <title>图片说明的显示和隐藏动画</title> <meta charset='utf-8'/> <style type="text/css"> body,ul,li,ol{list-style:none;padding:0px;margin:0px;font-size:12px;font-family:微软雅黑;} img{border:0px;} .picList{width:100%;float:left;} .picList .col{width:300px;height:200px;position:relative;overflow:hidden;float:left;margin:10px 0 0 10px;} .picList .col img,.col a{position:absolute;top:0px;left:0px;} .picList .col img{width:100%;} .picList .col a{display:block;width:280px;height:180px;top:160px;background:rgba(0,0,0,0.7);color:white;font-style:normal;line-height:25px;padding:10px;opacity:0.8;text-decoration:none;} .msg{float:left;width:900px;position:relative;left:50%;margin:30px 0 0 -450px;font-size:14px;} </style> </head> <body> <div class='picList'> <div class='col'> <img src='/jscss/demoimg/wall_s5.jpg'/><a href='#'>古老巨石阵<br/>巨石阵又称索尔兹伯里石环、环状列石、太阳神庙、史前石桌、斯通亨治石栏、斯托肯立石圈等名,是欧洲著名的史前时代文化神庙遗址,位于英格兰威尔特郡索尔兹伯里平原。</a> </div> <div class='col'> <img src='/jscss/demoimg/wall_s9.jpg'/><a href='#'>加拿大自然风光<br/>加拿大国家森林公园在加拿大塞尔客克山和珞矶山上,掩映于积雪的峰巅、庞大的冰河和澄澈的湖沼之间的,是全世界最壮丽的国家公园。</a> </div> </div> <script type="text/javascript" src="/ajaxjs/jquery-1.6.2.min.js"></script> <script type="text/javascript"> var temp=160; $('.picList .col').hover(function(){ $(this).find('a').stop(true).animate({top: temp=(temp==0?160:0) }); }); </script> </body> </html>
|
|
来自: 昵称15834968 > 《图片特效》