对悬浮窗进一步改进:

用this.className

可以省略script

<!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>无标题文档</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
.aa
{
background-color:#FF0; height: 40px;
width: 100px;
top: 60px;
left: 100px;
position: absolute;
overflow: hidden;
text-align: center;
line-height:40px;
}
.aaa
{
background-color:red; height: 40px;
width: 100px;
top: 60px;
left: 100px;
position: absolute;
overflow:visible;
text-align: center;
line-height:40px;
}
#bb{ height:120px;
width:100px;
top:40px;
left:0px;
position:absolute; }
table{ height:120px;
width:100px;
text-align:center;
vertical-align:middle;
}
.tiyu
{
height:40px;
width:100px;
position:absolute;
overflow:hidden;
left:0px;
top:0px;
}
.zuqiu
{
height:40px;
width:100px;
position:absolute;
overflow:visible;
left:0px;
top:0px;
}
#zuqiu
{
height:40px;
width:100px;
position:absolute;
left:100px;
top:0px;
background-color:#C63;
}
.yule
{
height:40px;
width:100px;
position:absolute;
overflow:hidden;
left:0px;
top:40px;
}
.bagua
{
height:40px;
width:100px;
position:absolute;
overflow:visible;
left:0px;
top:40px;
}
#bagua
{
height:40px;
width:100px;
position:absolute;
left:100px;
top:0px;
background-color:#C63;
}
.guoji
{
height:40px;
width:100px;
position:absolute;
overflow:hidden;
left:0px;
top:80px;
}
.junshi
{
height:40px;
width:100px;
position:absolute;
overflow:visible;
left:0px;
top:80px;
}
#junshi
{
height:40px;
width:100px;
position:absolute;
left:100px;
top:0px;
background-color:#C63;
}
</style>
</head> <body>
<div class="aa" onmousemove="this.className='aaa'" onmouseout="this.className='aa'">新闻动态
<div id="bb">
<table cellpadding="0" cellspacing="0"> <tr bgcolor="#0000FF"> <td height="40" width="100">
<div class="tiyu" onmouseover="this.className='zuqiu'" onmouseout="this.className='tiyu'">体育
<div id="zuqiu">足球</div></div></td> </tr> <tr bgcolor="#FFFF00">
<td height="40" width="100">
<div class="yule" onmousemove="this.className='bagua'" onmouseout="this.className='yule'">娱乐
<div id="bagua">八卦</div></div></td> </tr> <tr bgcolor="#00FFFF">
<td height="40" width="100">
<div class="guoji" onmouseover="this.className='junshi'" onmouseout="this.className='guoji'">国际新闻
<div id="junshi">军事</div></div></td>
</tr>
</table> </div></div> </body>
</html>

结果是一样的:

默认时

鼠标在新闻动态上面时

鼠标在体育上面时:

鼠标在娱乐上面时:

鼠标在国际新闻上面时:

JavaScrip——练习(做悬浮框再进一步:悬浮窗后缀悬浮窗——用this.className)的更多相关文章

  1. JavaScrip——练习(做悬浮框进一步:悬浮窗后缀悬浮窗【感觉这种方法比较麻烦】)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. JavaScrip——练习(做悬浮框)

    通过HTML.CSS.JSP来实现 1.首先确定通过div嵌套来实现: 大的div里放默认显示的一层,限制其总层次高,设置超出部分隐藏 小的div里放鼠标移过去时显示的一层:3行1列的表格 1.1.什 ...

  3. Android悬浮框,在Service中打开悬浮窗;在Service中打开Dialog;

    文章介绍了如何在Service中显示悬浮框,在Service中弹出Dialog,在Service中做耗时的轮询操作: 背景需求: 公司的项目现在的逻辑是这样的:发送一个指令,然后3秒一次轮询去查询这个 ...

  4. Android音视频通话过程中最小化成悬浮框的实现(类似Android8.0画中画效果)

    关于音视频通话过程中最小化成悬浮框这个功能的实现,网络上类似的文章很多,但是好像还没看到解释的较为清晰的,这里因为项目需要实现了这样的一个功能,今天我把它记录下来,一方面为了以后用到便于自己查阅,一方 ...

  5. 小米Adnroid默认禁止悬浮框的使用,导致开发的悬浮框无法接收事件

    比如你建了一个悬浮框: WindowManager windowManager = getWindowManager(context); int screenWidth = windowManager ...

  6. Echarts ecomfe 触摸屏 touch 在IE10下无法显示悬浮框

    问题描述: Windows 8 IE10浏览http://echarts.baidu.com/doc/example/line2.html 时,鼠标放置在数据点上时无法显示悬浮框. 正常情况为: 而现 ...

  7. C# 鼠标悬停在datagridview的某单元格,显示悬浮框效果

    今天在做项目时,看到一软件做的悬浮框效果不错,从网上搜罗了一些资料,未见到有十分好的解决办法,只能自已动手,利用datagridview 的ToolTipText 来达到此效果. 以下是我简单实现的代 ...

  8. Android -- 使用WindowManager实现悬浮框效果

    1,原文在这里http://blog.csdn.net/qq_17250009/article/details/52908791,我只是把里面的关键步骤给注释了一下,首先来看一下我们的效果,如图(电脑 ...

  9. 菜鸟学JS(三)——自动隐藏的悬浮框

    今天写一个小实例,用js和css写一个可以自动隐藏的悬浮框.css肯定是用来控制样式的,js用来控制器显示与隐藏的.显示与隐藏通常有两种方法实现:1,用js控制其显示属性:2,用js控制其大小. 今天 ...

随机推荐

  1. Python监控文件变化:watchdog

    Python监控文件变化有两种库:pyinotify和watchdog.pyinotify依赖于Linux平台的inotify,后者则对不同平台的的事件都进行了封装.也就是说,watchdog跨平台. ...

  2. HttpClient中的Timout

    connection timeout和SoTimeout A connection timeout occurs only upon starting the TCP connection. This ...

  3. DropBox 超实用的免费文件网络同步、备份、分享工具

    http://www.iplaysoft.com/dropbox.html DropBox 就是一款非常好用的免费网络文件同步工具(当然它也算是一个服务).当你在电脑A使用DropBox时,指定文件夹 ...

  4. 移动对meta的定义(转)

    以下是meta每个属性详解 尤其要注意的是content里多个属性的设置一定要用分号+空格来隔开,如果不规范将不会起作用. 一.<meta http-equiv="Content-Ty ...

  5. Find and Grep

    find 1.格式 Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [ ...

  6. [转]Hspice和Spice Explorer许可文件设置时环境变量FLEXLM_BATCH = 1的一些现象

    之前在T400上安装Spice Explorer时碰到运行Spice Explorer时只能看到Log界面,主程序界面自动消失的问题.后经论坛高手指点,在环境变量设置中去掉"FLEXLM_B ...

  7. mysql update常见实例

    在MySQL中使用update语句的时候,Where条件或者值都可以使用子查询,比如: ) ); 但是如果子查询和更新的表是同一个表的话,MySQL会报如下的错误:中涉及到的子查询要格外注意 Erro ...

  8. 生产环境JAVA进程高CPU占用故障排查

    问题描述:生产环境下的某台tomcat7服务器,在刚发布时的时候一切都很正常,在运行一段时间后就出现CPU占用很高的问题,基本上是负载一天比一天高. 问题分析:1,程序属于CPU密集型,和开发沟通过, ...

  9. 关于Virtual的英语含义

    不知道有人注意没有,virtual的英语含义是:实际的,事实上,实质上.但是在计算机英语内却表示:虚拟的意思.比如:virtual memery 虚拟内存,virtual reality 虚拟现实. ...

  10. Linux系统cp: omitting directory `XXX'问题解决

    在linux系统中复制文件夹时提示如下: cp: omitting directory `foldera/' 其中foldera是我要复制的文件夹名,出现该警告的原因是因为foldera目录下还存在目 ...