代码驿站移动版
频道导航
HTML/Xhtml
CSS
JavaScript
HTML5
PHP教程
ASP.NET
正则表达式
AJAX
ThinkPHP
Yii
MySQL
MariaDB
Oracle
MongoDB
Redis
DedeCMS
PHPCMS
帝国CMS
WordPress
Discuz
其它CMS
Zend Studio
Sublime
Notepad
Dreamweaver
Windows
Linux
Nginx
Apache
IIS
CentOS
Ubuntu
Debian
网站优化
工具资源
PHP源码
ASP.NET源码
其它源码
图标素材
按钮素材
字体素材
DedeCMS模板
帝国CMS模板
PHPCMS模板
WordPress模板
Discuz!模板
单页模板
开发软件下载
服务器软件下载
广告投放
联系我们
版权申明
软件编程
网页前端
移动开发
数据库
服务器
脚本语言
PHP代码
JAVA代码
Python代码
Android代码
当前位置:
主页
>
网页前端
>
HTML代码
>
div+css实现的滑动门,简洁,新手上路 (小鸽子系列)
时间:2021-06-27 08:21:53 | 栏目:
HTML代码
| 点击:次
以前回复过几个朋友,关于滑动门的代码,那时我还没有用上IE7,FF,结果,发现只能在IE6下运行,代码也很长;今天又有朋友问我这个,我只好花一点时间,终于把这个东东完成了,希望大家喜欢;
兼容IE7;FF;IE6
代码更简洁,更易读;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>滑动门</title> <style media="screen" type="text/css"> <!-- *{font-size:12px;} html,body{margin:0;text-align:center;over-flow:hidden;height:100%;width:100%;} UL{list-style-type:none; margin:0px;} /* 标准盒模型 */ .ttl{height:18px;} .ctt{height:auto;padding:6px;clear:both} .w936{width:936px;margin:2px 0;clear:both;border:1px solid skyblue} /* TAB 切换效果 */ .tb_{background-color: #E6F2FF; background-image: url('http://www.dc18.com/images/barbg_tab.gif'); background-repeat: repeat-x;} .tb_ ul{height:24px;} .tb_ li{float:left;height: 24px;padding-top: 6px;width: 94px;cursor:pointer;} .normaltab { background-image:url('http://www.dc18.com/images/normal_tab.gif'); background-repeat: no-repeat; color:#1F3A87 ;} .hovertab { background-image: url('http://www.dc18.com/images/hover_tab.gif'); background-repeat: no-repeat; color:#1F3A87; font-weight:bold } .dis{display:block;} .undis{display:none;} --> </style> <script type="text/javascript" language="javascript"> <!-- function g(o){return document.getElementById(o);} function HoverLi(n){ //如果有N个标签,就将i<=N; //本功能非常OK,兼容IE7,FF,IE6;http://www.xiaogezi.cn/ [小鸽子]系列 for(var i=1;i<=6;i++){g('tb_'+i).className='normaltab';g('tbc_0'+i).className='undis';}g('tbc_0'+n).className='dis';g('tb_'+n).className='hovertab'; } //--> </script> </head> <body> <div class="w936"> <div id="tb_" class="tb_"> <ul> <li id="tb_1" class="hovertab" onmouseover="xgz:HoverLi(1);">网上房展会</li> <li id="tb_2" class="normaltab" onmouseover="xgz:HoverLi(2);">本月开盘</li> <li id="tb_3" class="normaltab" onmouseover="xgz:HoverLi(3);">知名开发商</li> <li id="tb_4" class="normaltab" onmouseover="xgz:HoverLi(4);">栏目导航</li> <li id="tb_5" class="normaltab" onmouseover="xgz:HoverLi(5);">哈哈哈哈</li> <li id="tb_6" class="normaltab" onmouseover="xgz:HoverLi(6);">Q小鸽子</li> </ul> </div> <div class="ctt"> <div class="dis" id="tbc_01">内容1</div> <div class="undis" id="tbc_02">内容2</div> <div class="undis" id="tbc_03">内容3</div> <div class="undis" id="tbc_04">内容4</div> <div class="undis" id="tbc_05">内容5</div> <div class="undis" id="tbc_06">内容6 [Q小鸽子]</div> </div> </div> <hr author="http://xiaogezi.cn" style="color:red;" /> </body> </html>
[Ctrl+A 全选 注:
引入外部Js需再刷新一下页面才能执行
]
您可能感兴趣的文章:
CSS hack实现 CSS完美兼容IE6/IE7/FF的通用方法
用CSS控制的闪烁效果
css不用图片美化按钮
兼容多浏览器实现半透明(Opera ie firefox)
什么是XHTML?
相关文章
11-12
用CSS给图片打标的代码
10-07
iframe背景透明的设置方法
11-03
怎么改善现有网站
12-03
不要使用CSS Expression的原因分析
11-18
CSS Hack 汇总快查
JQuery
VUE
AngularJS
MSSql
MySQL
MongoDB
Redis
Linux
Tomcat
Nginx
网站首页
广告投放
联系我们
版权申明
联系站长