<script>
window.onload = function(){
var oDiv1 = document.getElementById("div1");
var oDiv2 = document.getElementById("div2");
var timer = null;
oDiv1.onmouseover = function () {
clearTimeout(timer);
oDiv2.style.display = "block";
}
oDiv1.onmouseout = function(){
timer = setTimeout(function(){
oDiv2.style.display = "none";
}, 400);
}
oDiv2.onmouseover = function(){
clearTimeout(timer);
this.style.display = "block";
}
oDiv2.onmouseout = function(){
timer = setTimeout(function() {
oDiv2.style.display = "none";
}, 400);
}
}
</script>

触发显示和隐藏 div的更多相关文章

  1. js简单显示和隐藏div,触发超链接,动态更改button值,setInterval()简单使用,jquery easyui弹出框简单使用 .

    js简单显示和隐藏div .<!DOCTYPE html> .<html> .<head> .<meta charset="UTF-8"& ...

  2. JavaScript网站设计实践(四)编写about.html页面,利用JavaScript和DOM,选择性的显示和隐藏DIV元素

    一.现在我们在网站设计(三)的基础上,来编写about.html页面. 这个页面要用到的知识点是利用JavaScript和DOM实现选择性地显示和隐藏某些DIV about.html页面在前面我们为了 ...

  3. JS 实现显示和隐藏div(以百度地图为例)

    主要参考的文章:https://my.oschina.net/xsh1208/blog/215811,https://zhidao.baidu.com/question/568774688.html ...

  4. jquery显示、隐藏div的方法

    $("#top_notice").css("display", "block");//第1种方法 //$("#top_notice ...

  5. 问题:关于坛友的一个定时重复显示和隐藏div的实现

    需求:打开页面只看到DIV2,等完秒数之后在显示DIV3.手动关闭DIV3后在重新数秒 我设置的间隔时间是3秒,代码如下: html+css: 1: <!DOCTYPE HTML> htm ...

  6. jquery点击区域显示或隐藏DIV,点击非该DIV的地方隐藏该DIV

    <div class="Content_top"> <div class="Reserve"> <h3><span c ...

  7. jquery点击按钮显示和隐藏DIv

    function changeDisplay() { if ($("#btnShow").attr("value")== "添加附件") { ...

  8. 显示或隐藏div

    代码来源于博客,如有侵权,请联系我! ASP.NET中TextBox控件设置ReadOnly="true"H或Enabled=false后台取不到值 当TextBox设置了Read ...

  9. React 点击按钮显示div与隐藏div,并给div传children

    最近做了一个react的点击按钮显示与隐藏div的一个小组件: [筛选]组件FilterButton import React,{Component} from 'react'; import {re ...

随机推荐

  1. 【转载】#446 - Deciding Between an Abstract Class and an Interface

    An abstract class is a base class that may have some members not implemented in the base class, but ...

  2. 解决Could not get lock /var/cache/apt/archives/lock

    在ubuntu apt-get upgrade的时候,遇到: E: Could not get lock /var/cache/ apt/archives/lock - open (11 Resour ...

  3. vuejs 开发中踩到的坑

    用 v-for 循环式  每个item的值相等的情况下,会影响v-model的双向绑定: Modal 组件开发,主要用slot 标签来实现 <template> <transitio ...

  4. Joker

    人生的第一位老师当然是我的爸妈,他们生我下来,教我学会走路讲话,教会我做人的道理,当然,他们还给我名字.人生的第二位老师就是我的初中老师,初中班主任对我非常好,在之后的考上市一中也是其中的缘由,初中班 ...

  5. Unity3d Gis 坐标转换

    最近在做unity3d与Gis结合的项目,最基本的就是坐标的转换问题,比如把经纬度为(166.23.9.27 , 39.55.15.74) 转换到unity里面成相应的位置点,废话不多说 上代码: u ...

  6. 固定导航栏demo

    代码如下 <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF- ...

  7. select 文字右对齐

    select { direction: rtl; } select option { direction: ltr; }

  8. Unity 游戏框架搭建 (九) 减少加班利器-QConsole

    为毛要实现这个工具? 在我小时候,每当游戏在真机运行时,我们看到的日志是这样的. 没高亮啊,还有乱七八糟的堆栈信息,好干扰日志查看,好影响心情. 还有就是必须始终连着usb线啊,我想要想躺着测试... ...

  9. c#最近博文结尾

    总结一下最近的内容.最近休息一段时间,学习了很多内容,研究了一些新的东西.也不说了.前面的博文主要内容. (1)分布式部署(etcd) (2) 分布式注意事项 (3)c#序列化(messagepack ...

  10. ABAP术语-Customer Enhancement

    Customer Enhancement 原文:http://www.cnblogs.com/qiangsheng/archive/2008/01/18/1043874.html Adjustment ...