惊!!!求解,类似QQlive导航栏的背景切换停留!
时间:2010-06-03
来源:互联网
一直没找到这样的代码,独立的
http://live.qq.com/movie/all/hot2/list_1.html
就是鼠标移动上去后背景变换,网页切换完成后背景停留,其他背景还原
<div class="nav_content">
<a target="_self" href="http://live.qq.com/index.html"><strong>首页</strong></a>
<a target="_self" href="http://live.qq.com/zb/index.html"><strong class="tl">电视台</strong></a>
<a target="_self" class="current" href="http://live.qq.com/movie/all/hot2/list_1.html"><strong>电影</strong></a>
<a target="_self" href="http://live.qq.com/tv/all/hot2/list_1.html"><strong class="tl">电视剧</strong></a>
<a target="_self" href="http://live.qq.com/cartoon/all/hot2/list_1.html"><strong>动漫</strong></a>
<a class="last" target="_self" href="http://live.qq.com/variety/index.html"><strong>综艺</strong></a>
</div>
QQ截图未命名.jpg (7.97 KB)
http://live.qq.com/movie/all/hot2/list_1.html
就是鼠标移动上去后背景变换,网页切换完成后背景停留,其他背景还原
<div class="nav_content">
<a target="_self" href="http://live.qq.com/index.html"><strong>首页</strong></a>
<a target="_self" href="http://live.qq.com/zb/index.html"><strong class="tl">电视台</strong></a>
<a target="_self" class="current" href="http://live.qq.com/movie/all/hot2/list_1.html"><strong>电影</strong></a>
<a target="_self" href="http://live.qq.com/tv/all/hot2/list_1.html"><strong class="tl">电视剧</strong></a>
<a target="_self" href="http://live.qq.com/cartoon/all/hot2/list_1.html"><strong>动漫</strong></a>
<a class="last" target="_self" href="http://live.qq.com/variety/index.html"><strong>综艺</strong></a>
</div>
附件

2010-6-3 18:11
QQlive导航栏
作者: sees2012 发布时间: 2010-06-03
这种标签导航现在用的很广泛的 你扒一下QQlive导航栏的 CSS文件 有解答
作者: bluehoriz 发布时间: 2010-06-03
这个是有分2种情况的(从静态页面考虑)
一:在一个页面可以用如下代码
一:在一个页面可以用如下代码
<!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 type="text/css"> .a{ float:left; background-color:#FFFFFF; border:1px solid #000000; font-weight:bold;} .b{ float:left; background-color:#0000FF; border:1px solid #000000; font-weight:bold;} .c{ color:#ffffff;} </style> </head> <body> <div id="nav"> <div class="b" id="m01"><a href="" class="c" onclick="this.blur()">111</a></div> <div class="b" id="m02"><a href="" class="c">222</a></div> <div class="b" id="m03"><a href="" class="c">333</a></div> <div class="b" id="m04"><a href="" class="c">444</a></div> <div class="b" id="m05"><a href="" class="c">555</a></div> <div class="b" id="m06"><a href="" class="c">666</a></div> </div> <script type="text/javascript"> var cur = 'm01';//默认第几个菜单[值为该菜单项的ID值] var nav = document.getElementById('nav').getElementsByTagName('div'); var nal = nav.length; for(var i=0;i<nal;i++) { if(nav[i].id == cur)nav[i].className = 'a'; nav[i].onmouseover = function() { document.getElementById(cur).className = 'b'; this.className = 'a';//当前样式 } nav[i].onclick = function() { cur = this.id; } nav[i].onmouseout = function() { this.className = 'b';//当前样式 document.getElementById(cur).className = 'a'; } } </script> </body> </html>
提示:您可以先修改部分代码再运行
二:在不同页面,单独定义样式 提示:您可以先修改部分代码再运行
作者: qxq864298 发布时间: 2010-06-03
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28