![js实现仿网易点击弹出提示同时背景变暗效果【javascript】](https://600zi.400zi.cn/uploadfile/img/14/552/51be9ea765a32d781026f9df00be7954.jpg)
web前端|js教程
js,仿网易,弹出提示,背景变暗
web前端-js教程
本文实例讲述了js实现仿网易点击弹出提示同时背景变暗效果。分享给大家供大家参考。具体如下:
富贵电玩最新源码,ubuntu解锁恢复,tomcat7 管理密码,企业爬虫服务,php三维数组变二维,常熟市seo关键词优化lzw
这里仿网易点击弹出提示,背景变暗提示层效果,圆角,美观简洁,代码稍嫌多。
自动建站平台源码,ubuntu怎么搭建nfs,爬虫车乐高,php = 引用,seo新趋势lzw
运行效果下图例:
虚拟商城源码l,Ubuntu系统提示乱码,tomcat7配置2个工程,爬虫办公室,php学生个性标签设计思路,小店通seolzw
在线演示地址如下:
/js//js-sina-dialog-bgcolor-codes/
具体代码如下:
点击弹出提示,背景变暗function msg(info){var p=document.createElement("DIV");if (!info) var info=欢迎光临;p.id="p";p.style.position="absolute";p.style.width=document.body.scrollWidth;p.style.height=(document.body.offsetHeight>document.body.scrollHeight)?100%:document.body.scrollHeight;p.style.zIndex=998;p.style.top= px; p.style.left= %;p.style.backgroundColor="gray";p.style.opacity= .5;p.style.filter="alpha(opacity=80)";document.body.appendChild(p);var p1=document.createElement("DIV");var top=parseInt(parseInt(document.body.scrollHeight)*0.25)+document.body.scrollTop;p1.style.position="absolute";p1.style.width="300px";p1.id="p1";var left=Math.ceil(((document.body.scrollWidth)-parseInt(p1.style.width.replace(px,\)))/2)+document.body.scrollLeft;p1.style.height="200px";p1.style.zIndex=999;p1.style.top=top+px; p1.style.left=left+px;p1.style.border="0px solid red";var html=""; html+="" html+="
" html+="
" html+="
" html+="
⊙ 友情提示:
"html+="
"+info+"
[ 关闭 ]
" html+="
" html+="
" html+="
" html+=""document.body.appendChild(p1);p1.innerHTML=html;var arr=document.getElementsByTagName("select");var i=0;while(i