JS实现仿微博可关闭弹出层效果

2022-01-13,,,

这篇文章主要介绍了JS实现仿微博可关闭弹出效果,涉及JavaScript弹出窗口的设置及页面元素动态操作的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下

本文实例讲述了JS实现仿微博可关闭弹出层效果。分享给大家供大家参考。具体如下:

这里推荐给大家一款真心不错的JavaScript网页弹出层,仿微博JS弹出层可关闭,点击按钮才弹出来,可制作成网页客服之类的,比如在网页的右侧显示这么一个按钮,当点击的时候,展开层,显示客服QQ,效果还是很不错的!

运行效果截图如下:

在线演示地址如下:

http://demo.html.cn/js/2015/js-f-weibo-close-able-alert-codes/

具体代码如下:

   圆角弹出层DIV CSS body{ font-size:12px;} .tit{ font-size:14px; padding:0; margin:0; height:31px; line-height:31px; background: url(images/titbg.gif) center top repeat-x #CBE4EF;} .tit b{ float:left; margin-left:15px;} .tit a{ float:right; margin-right:5px; margin-top:6px; display:inline;} a.cls{height:18px; width:18px;display:block; overflow:hidden; line-height:200px;} .nr{padding:10px; text-align:left;} a.cls,a.cls:link,a.cls:visited{background:url(images/cls.gif) center 0 no-repeat;} a.cls:hover{background:url(images/cls.gif) center -20px no-repeat;} .box{ border:1px #999999 solid; background:#FFF;} /*圆角边框*/ .lt,.rt,.lb,.rb{ background-image:url(images/abg.png-600);filter:alpha(opacity=10);-moz-opacity:.1;opacity:.1;line-height:0;} .lt,.rt,.lb,.rb{ height:6px;width:6px;}.t,.b,.l,.r{ background:#000000;filter:alpha(opacity=10);-moz-opacity:.1;opacity:.1;line-height:0;} .l,.r{width:6px;}.t,.b{height:6px;}.lt{ background-position:0 0;}.rt{ background-position:right 0;}.lb{ background-position:0 bottom;}.rb{ background-position:right bottom;} /*小三角*/ s{position:absolute;top:-13px;*top:-13px;left:50px;display:block;height:0;width:0;font-size:0; line-height: 0;border-color:transparent transparent #666 transparent;border-style:dashed dashed solid dashed;border-width:10px;} i{position:absolute;top:-9px;*top:-9px;left:-10px;display:block;height:0;width:0;font-size: 0;border-width:10px; line-height: 0;border-color:transparent transparent #FFF transparent;border-style:dashed dashed solid dashed;} .open{ position:relative; width:150px; height:25px;line-height:180%; border:1px solid #FF9900; background:#FFCC00;margin:12% auto 0 400px; text-align:center;} .open span{cursor:pointer; display:block; width:100%;} .odiv{ position:absolute; top:29px; left:-1px; width:300px;}  点击这里,弹出层

这里是标题关闭

提示:
1、在代码状态下使用[html][/html]可以贴“代码运行”的代码。并禁用发帖左侧的 URL 识别和标签解析
2、技术版面请勿灌水。特别受欢迎的主题可以顶一顶,但是请接受版主的定期“擦水”,这是为了减少技术讨论区出现的无效信息。
3、如需要收藏主题,请使用主题右上角的链接,还可以推荐给论坛里的朋友。
此方法简单,自适应内容高宽,易方便改风格。

希望本文所述对大家的JavaScript程序设计有所帮助。

以上就是JS实现仿微博可关闭弹出层效果的详细内容,更多请关注本站其它相关文章!

《JS实现仿微博可关闭弹出层效果.doc》

下载本文的Word格式文档,以方便收藏与打印。