JavaScript实现延时提示框
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style type="text/css">
#div1 {
width: 50px;
height: 50px;
background: red;
margin: 10px;
display: block;
}
#div2 {
width: 300px;
height: 300px;
background: #868282;
display: none;
}
</style>
</head>
<body>
<div id="div1"></div>
<div id="div2"></div>
<script>
var odiv1=document.getElementById('div1');
var odiv2=document.getElementById('div2');
var timer=null;
odiv1.onmouseover=odiv2.onmouseover=function()
{
clearTimeout(timer); /*当鼠标移到div2时关闭定时器*/
odiv2.style.display='block';
}
odiv1.onmouseout=odiv2.onmouseout=function()
{
timer=setTimeout(
function()
{
odiv2.style.display='none';
},1000); /*1秒后再消失*/
}
</script>
</body>
</html>
JavaScript实现延时提示框的更多相关文章
- 延时提示框制作思路[简单javascript案例]
模拟QQ软件中的弹出提示框功能,制作一个简易的延时提示框. 功能实现: 1.当鼠标移入指定区块时,弹出隐藏的区块:当鼠标移出指定区块时,弹出的隐藏区块再次隐藏. 2.同时要求在鼠标移入该弹出区块后,区 ...
- JS延时提示框
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 31.0px Consolas; color: #2b7ec3 } p.p2 { margin: 0.0px ...
- JS定时器的使用--延时提示框
<title>无标题文档</title> <style> div{float:left;margin:10px;} #div1{width:50px; height ...
- jQuery警告/确认/提示弹出对话框效果(替换传统JavaScript下的提示框)
http://www.51xuediannao.com/js/jquery/jquery_tsk/ http://www.jq22.com/demo/jqueryConfirm20160413/
- javascript中简单提示框
CSS部分 .help-tip{ width: 340px; border:1px solid #A0A0A0; background-color: #F8F8F8; border-radius: 5 ...
- 用setTimeout模拟QQ延时提示框
很简单的代码,不多解释,一看就懂. <!DOCTYPE html> <html> <head> <meta http-equiv="Content- ...
- JS学习笔记 -- 定时器,提示框的应用
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- for循环执行时在,每执行一次for循环中弹出提示框,延时问题
在需求中,ajax的返回值,根据数组内容的长度去做循环,每循环一次弹出提示框,发现for循环的执行速度非常之快,想到了延时,但是在for循环中延时并不能解决这个问题. 查到setTimeout的递归处 ...
- JavaScript 消息框,警告框,确认框,提示框
1.警告框 警告框经常用于确保用户可以得到某些信息. 当警告框出现后,用户需要点击确定按钮才能继续进行操作. 语法: alert("文本") 2.确认框 确认框用于使用户可以验证或 ...
随机推荐
- Apache_安装
1.下载安装包 网址:https://www.apachelounge.com/download/,下载你需要的安装包 2.解压文件到指定安装目录 3.修改配置文件 使用文本编辑器打开配置文件 con ...
- grunt入门 出处:http://artwl.cnblogs.com
grunt-contrib-uglify uglify是一个文件压缩插件,项目地址:https://github.com/gruntjs/grunt-contrib-uglify 本文将以一个DEMO ...
- Qt Quick编程(1)
说道QML,不得不先说一下ECMAScript: ECMAScript语言的标准是由Netscape.Sun.微软.Borland等公司基于JavaScript和JScript锤炼.定义出来的. EC ...
- Spring Cloud-hystrix使用例子(七)
继承方式 HystrixCommand public class UserSelectAllCommand extends HystrixCommand<List<User>> ...
- netty helloWord (一)
什么是nettty netty是基于javaNio模型的网络编程框架.很多框架底层也是用netty实现的 比如dubbo 与NIO的区别 1.简化了API的使用.基于事件驱动.只需要在对应的事件写相应 ...
- 如何预防SQL注入,XSS漏洞(spring,java)
SQL注入简介 SQL注入是由于程序员对用户输入的参数没有做好校验,让不法分子钻了SQL的空子, 比如:我们一个登录界面,要求用户输入用户名和密码: 用户名: ' or 1=1-- 密码: 点击登录之 ...
- 浅析IT系统监控方法和应用
浅析IT系统监控方法和应用 http://blog.csdn.net/zhangman117/article/details/35549363
- mdl 锁 SYSTEMTAP跟踪
systemtap : 各种资源的使用限制由所生成的C代码中的宏来设置.这些值可在编译时由-D选项来重写.下面描述了部分挑选出来的宏: MAXNESTING 递归函数的最大调用层数,默认值是10. M ...
- ios weak和strong的差别
The difference is that an object will be deallocated as soon as there are no strong pointers to it. ...
- wpf Textbox 点击选中全部文本
用法:依赖属性 SelectTextOnFocus.Active = True public class SelectTextOnFocus : DependencyObject { public s ...