当移动到菜单“小说”,“非小说”,“少儿”时菜单背景变换,并显示相应内容:

<!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=utf-8" />
<title>tab切换</title>
<style type="text/css">
.img{
background:url(images/menu2.gif);
margin-left:2px;
width:47px; height:23px;
float:left;
font-size:14px; text-align:center; color:#FFF
}
ol{font-size:14px; color:#39F; line-height:20px
}
</style>
</head> <body>
<div style="background:url(images/bg.jpg) ;width:170px; height:290px; float:left">
<div style="margin-top:50px;margin-left:10px; float:left"> <!--导航栏头目-->
<div class="img" id="id1" onmouseover="show1()" onmouseout="out()">小说</div>
<div class="img" id="id2" onmouseover="show2()" onmouseout="out()">非小说</div>
<div class="img" id="id3" onmouseover="show3()" onmouseout="out()">少儿</div>
<div> <!--小说列目开始-->
<ol style="margin-left:-10px;margin-top:20px; float:left; display:none" id="show1" >
<li>时间旅行者的妻子</li>
<li>女心理师(下)</li>
<li>鬼吹灯之精绝古城</li>
<li>女心理师(上)</li>
<li>小时候</li>
<li>追风筝的人</li>
<li>盗墓笔记2</li>
<li>输赢</li>
</ol> <!--小说列目结束--> <!--非小说列目开始-->
<ol style="margin-left:-10px;margin-top:20px; float:left; display:none " id="show2">
<li>人生若只如初见</li>
<li>高效能人士的七个</li>
<li>求医不如求己</li>
<li>人体使用手册</li>
<li>孩子,把你的手给我</li>
<li>别笑!我是英文单词书</li>
<li>人体经络使用手册</li>
<li>股市稳赚</li>
</li>
</ol>
<!--非小说列目结束--> <!--少儿列目开始--> <ol style="margin-left:-10px;margin-top:20px; float:left; display:none " id="show3">
<li>斯凯瑞金色童书</li>
<li>哈利。波特</li>
<li>不一样的卡梅拉</li>
<li>他们是怎么来的</li>
<li>五。三班的坏小子</li>
<li>男生日记</li>
<li>哈利波特与魔法石</li>
<li>噼里啪啦丛书</li>
</ol>
<!--少儿列目结束-->
</div> </div>
</body>
<script> //定义小说函数方法
function show1(){
var id1=document.getElementById("id1");
id1.style.background="url(images/menu1.gif)"
var show1=document.getElementById("show1");
show1.style.display="block";
} //定义非小说函数方法
function show2(){
var id2=document.getElementById("id2");
id2.style.background="url(images/menu1.gif)"
var show2=document.getElementById("show2");
show2.style.display="block";
} //定义少儿函数方法
function show3(){
var id3=document.getElementById("id3");
id3.style.background="url(images/menu1.gif)"
var show3=document.getElementById("show3");
show3.style.display="block";
} //定义鼠标移动函数方法
function out(){ var id=document.getElementById("id1");
id.style.background="url(images/menu2.gif)"
var show1=document.getElementById("show1");
show1.style.display="none"; var id2=document.getElementById("id2");
id2.style.background="url(images/menu2.gif)"
var show2=document.getElementById("show2");
show2.style.display="none"; var id3=document.getElementById("id3");
id3.style.background="url(images/menu2.gif)"
var show3=document.getElementById("show3");
show3.style.display="none"; }
</script>
</html>

实现三联tab切换特效的更多相关文章

  1. WPF案例(-)模拟Windows7 Win+Tab切换

    原文:WPF案例(-)模拟Windows7 Win+Tab切换 一个使用Wpf模拟Windows7 Win+Tab页面切换的小程序,使用快捷键Ctrl+Down或Ctrl+Up在示例程序各个页面元素之 ...

  2. 基于HTML5 Tab选项卡动画切换特效

    基于HTML5 Tab选项卡动画切换特效.这是一款基于HTML5+CSS3实现的带有动画切换效果的Tab选项卡插件cbpFWTabs.效果图如下: 在线预览   源码下载 实现的代码. html代码: ...

  3. jQuery实现TAB选项卡切换特效简单演示

    本文实例为大家分享jQuery实现TAB选项卡切换特效,供大家参考,具体内容如下 1.tab切换 on ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 ...

  4. Vue.js实现tab切换效果

    利用Vue实现简易tab切换效果 1.1 在我们平时浏览网站的时候,经常看到的特效有图片轮播.导航子菜单的隐藏.tab标签的切换等等.这段时间学习了vue后,开始要写出一些简单的特效. 1.2 实现思 ...

  5. 谈谈一些有趣的CSS题目(八)-- 纯CSS的导航栏Tab切换方案

    开本系列,谈谈一些有趣的 CSS 题目,题目类型天马行空,想到什么说什么,不仅为了拓宽一下解决问题的思路,更涉及一些容易忽视的 CSS 细节. 解题不考虑兼容性,题目天马行空,想到什么说什么,如果解题 ...

  6. JavaScript的Tab切换

    在网页设计中经常要用到tab切换,遂整理了一下常用的两种方法. 先看一下示例代码: HTML: <!doctype html> <html lang="en"&g ...

  7. jquery实现tab切换完整代码

    代码如下,保存到html文件打开: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ...

  8. js用户管理中心tab切换界面模板

    效果体验:http://hovertree.com/texiao/js/27/ 效果图如下: 代码如下: <!DOCTYPE html> <html> <head> ...

  9. ALT+TAB切换时小图标的添加 界面透明 屏幕大小 竖行字体 进程信息

    一,ALT+TAB切换时小图标的添加 Dlg类中添加变量 protected: HICON m_hIcon; #define IDR_MAINFRAME 128 ICON IDR_MAINFRAME, ...

随机推荐

  1. BZOJ 1051 HAOI 2006 受欢迎的牛

    [题解] 先用tarjan缩点,然后如果某个强联通分量的出度为0,则该强联通分量内的点数为答案,否则无解.因为若其他所有的强联通分量都有边连向Ai,则Ai必定没有出边,否则Ai连向的点所属的强联通分量 ...

  2. PAT 1102 Invert a Binary Tree

    The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote ( ...

  3. Huawei-R&S-网络工程师实验笔记20190609-VLAN划分综合(Access和Trunk端口)

    >Huawei-R&S-网络工程师实验笔记20190609-VLAN划分综合(Access和Trunk端口) >>实验开始,先上拓扑图参考: >>>实验目标 ...

  4. time库

    简介 返回系统当前时间戳(正常的生活时间) 返回格林威治时间戳对应的struct_time对象 本地时间的struct_time对象 当前时间戳对应的易读格式字符串时间(周几,月份,号数,时,分,秒, ...

  5. crontab定时任务安装、使用方法

    本文介绍下,在linux中安装crontab的方法,以及crontab的具体用法,有需要的朋友参考下. 这里使用yum方式安装crontab:  复制代码代码示例: [root@CentOS ~]# ...

  6. Struts2 值栈总结(ValueStack)

    1.获取值栈 //获取值栈的第一种方式 ValueStack valueStack1 = (ValueStack) ServletActionContext.getRequest().getAttri ...

  7. [bzoj1634][Usaco2007 Jan]Protecting the Flowers 护花_贪心

    Protecting the Flowers 护花 bzoj-1634 Usaco-2007 Jan 题目大意:n头牛,每头牛有两个参数t和atk.表示弄走这头牛需要2*t秒,这头牛每秒会啃食atk朵 ...

  8. HDU 4508

    祼的完全背包问题 #include <iostream> #include <cstdio> #include <cstring> #include <alg ...

  9. php导入sql文件

    php导入sql文件 sql php php导入sql文件 基本思路 1.打开sql文件,放入一个变量(字符串类型)其中 2.使用正则替换掉其中的凝视("--"与"/** ...

  10. Apache Traffic Server 5.3.1公布

    本文来源于我在InfoQ中文站翻译的文章,原文地址是:www.infoq.com/cn/news/2015/07/traffic-server-5.3.1-release 近日,Apache软件基金会 ...