zoukankan
html css js c++ java
弹出层
<html xmlns="
http://www.w3.org/1999/xhtml
" >
<head runat="server">
<title>弹出层</title>
<script type ="text/javascript" src ="jquery-1.4.2.min.js" ></script>
<script type ="text/javascript" >
$(document).ready(function()
{
//动画速度
var speed=500;
//绑定事件处理
$("#btnShow").click(function(event)
{
//取消事件冒泡
event.stopPropagation();
//设置弹出层的位置
var offset=$(event.target).offset();
$("#divTop").css({top:offset.top+$(event.target).height()+"px",left:offset.left});
$("#divTop").show(speed);
})
//单击空白区域隐藏层
$(document).click(function(event)
{
$("#divTop").hide(speed);
}
)
//单击层隐藏自身
$("#divTop").click(function(event)
{
$("#divTop").hide(speed);
})
}
)
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<br /><br /><br />
<button id ="btnShow">显示提示文字</button>
</div>
<div id ="divTop" style ="background-color:#f0f0f0; border : solid 1px #000000; position :absolute ; display :none ; width :300px ; height :100px">
<div style =" text-align:center "> 弹出层</div>
</div>
</form>
</body>
</html>
查看全文
相关阅读:
iOS 十六进制字符串 "#FFFF00" 转换成颜色对象
iOS toast 的连续显示
文件管理
pod 常用命令
键盘事件
iOS 添加阴影
渐变色
Ubuntu安装flameshot截图工具
Ubuntu安装酸酸乳客户端
Ubuntu安装网易云音乐
原文地址:https://www.cnblogs.com/tangself/p/1995367.html
最新文章
iOS 拨打电话优化
iOS 获取手机型号,系统版本
app卡顿问题检测--KMCGeigerCounter (转自http://www.cnblogs.com/gaoxiaoniu/p/5336463.html)
iOS 开发小技巧总结(会慢慢添加)
支付宝回调
ScrollView的循环播放
谈谈tableView的重要属性内边距
iOS编码规范
iOS 升级HTTPS通过ATS你所要知道的
RunLoop 总结:RunLoop的应用场景(二)
热门文章
RunLoop 总结:RunLoop的应用场景(一)
对于程序员, 为什么英语比数学更重要? 如何学习
Undefined symbols for architecture arm64解决方案
看完你也能独立负责项目!产品经理做APP从头到尾的所有工作流程详解!
xcode8.0升级之后公司项目遇到的问题
在C语言中利用PCRE实现正则表达式
JSPatch来更新已上线的App中出现的BUG(超级详细)
iOS 分类:按顺序添加视图
iOS 获取 UILabel 的宽度
iOS 获取 UILabel串的宽度
Copyright © 2011-2022 走看看