您的位置:首页 > Web前端 > CSS

CSS+Js遮罩效果的TAB及焦点图片切换(推荐)

2009-11-08 22:11 951 查看
Js遮罩效果的TAB及图片切换 div, ul, ol, li, dl, dt, dd { margin:0; padding:0; } .imgFlash,.tab{margin:auto} /*------焦点图片的css-------*/ .imgFlash { height:230px;width:270px; position:relative; } .imgFlash dl { height:100%; overflow:hidden; position:absolute; width:100%; } .imgFlash img { height:100%; position:absolute; width:100%; background-color: #FFFFFF; background-repeat: no-repeat; background-position: center center; } .imgFlash dt { bottom:0; font-size:12px; height:24px;line-height:24px; left:0; position:absolute; width:100%; z-index:1; } .imgFlash dt span { background-color:#000000; height:100%; opacity:0.4;filter:Alpha(Opacity=40); position:absolute; width:100%; } .imgFlash dt a { color:#FFFFFF; position:absolute; text-decoration:none; text-indent:5px; z-index:1; } .imgFlash dt a:hover { text-decoration:underline; } .imgFlash div { bottom:8px; cursor:pointer; display:block; position:absolute; right:8px; z-index:99999; } .imgFlash div em { background-color:#000000; border:1px solid #FFFFFF; display:block; float:right; height:4px; margin-right:3px; filter:Alpha(Opacity=50);opacity:0.5; overflow:hidden; width:4px; } .imgFlash div em.d {/*激活的小方块的样式*/ background-color:#CC0000; filter:Alpha(Opacity=80); opacity:0.8; } /*-------------------------Tab的css----------------------------*/ .tab,.tab ul{list-style-type: none;} .tab{ width:270px; background-color:#FFFFFF; height: 160px; font-size: 12px; position: relative; border-top-width: 30px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0066FF; border-right-color: #0066FF; border-bottom-color: #0066FF; border-left-color: #0066FF; } .tab ul { position: absolute; top: -30px; } .tab li{ float:left; background-color:#A9CEEB; background-repeat:no-repeat; background-position:left top; margin-top:5px; margin-left: 5px; } .tab li.d { background-color: #FFFFFF; } .tab li a{text-decoration:none;display:block;padding-right:8px;padding-left:8px;line-height:25px;color:#2B6FA2;} .tab li.d a{color:#0C3E74;} .tab li ul{ border-bottom-style:none; position:absolute; left:0px; top:30px; background-color: #FFFFFF; padding-top: 10px; width: 270px; } .tab li li{ float:none; background-image:none; margin:0px; background-color: #FFFFFF; } .tab li li a{ background-image:none; line-height:22px; color: #000000; float: none; height: 22px; } .tab li ul li a:hover{text-decoration:underline;} .tab li.d li a{color:#000000;}
神秘花园
脚本之家演示
人间仙境
[/li]
  • 源码下载
  • 短标题
  • 更短
    [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
    其实这个不只是效果,代码也是非常值得学习的。大家主要是注意页面最下面的代码
    <script>
    new ImgFlash($("box"));//初始化
    new Tab($("tab1"),"mouseover");
    </script>

    您可能感兴趣的文章:

  • 内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息