分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 教程案例

Js onmouseover和onmouseout小特效

发布时间:2023-09-06 01:31责任编辑:胡小海关键词:暂无标签
<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><title>Examples</title><meta name="description" content=""><meta name="keywords" content=""><link href="" rel="stylesheet"><style> ???div{float:left;margin:20px;} ???#div1{width:100px;height:100px;background: #f00;} ???#div2{width:200px;height:200px;background:#ccc;display: none;}</style> <script type="text/javascript"> ???window.onload=function(){ ???????var oDiv1=document.getElementById("div1"); ???????var oDiv2=document.getElementById("div2"); ???????var timer=null; ???????oDiv1.onmouseover= oDiv2.onmouseover=function(){ ???????????clearTimeout(timer); ???????????oDiv2.style.display="block"; ???????} ????????oDiv1.onmouseout= oDiv2.onmouseout=function(){ ??????????timer=setTimeout(function(){ ???????????????oDiv2.style.display="none"; ???????????},500) ???????} ???????????}</script></head><body> ???<div id="div1"></div> ???<div id="div2"></div></body></html>

Js onmouseover和onmouseout小特效

原文地址:http://www.cnblogs.com/itsmart/p/8047784.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved