在js中,当满足某一条件时弹出下面这个div,就是个类似qq控件最新动态的那个,
不过我这个要显示在页面中间,求各位高手给指点指点,代码越精炼越好
<div id="showMessage">
<div>您有新消息</div>
<div><a href="#">知道了</a></div>
</div>
不过我这个要显示在页面中间,求各位高手给指点指点,代码越精炼越好
<div id="showMessage">
<div>您有新消息</div>
<div><a href="#">知道了</a></div>
</div>
解决方案 »
- if(document.form1.cb[i].checked) 不明白什么意思?
- 关于加号展现问题
- 如何取得jw_flv_player当前播放时间和判断播放结束
- js 怎么判断空链接 跨链接网址的状态怎么获取
- 动态select正确传值的问题?
- 关于back(1)之后的页面数据保留问题
- jsp用insert插入数据,但不能录入数据库,请各位大侠帮忙
- 如何把两个表单排列于同一<TABEL>的不同<TR></tr>中,比如<form1><tr>....</tr><tr><form2>....</form2></tr><tr><form1></form1></tr>
- javascript里面如何知道一个字符串的长度?
- 用javascript,怎样让文本框自动显示和隐藏???
- 判断包含&号的字符是否相等的问题
- jQuery 更换动作问题?
window.onclick=function(){
var wind=document.createElement("div");
var mes=document.createElement("div");
mes.innerHTML="你有新消息";
var link=document.createElement("a");
link.href="#";
link.onclick=function(){history.go(1);return false;};//你可忽略。
link.innerHTML="知道了";
wind.appendChild(mes);
wind.appendChild(link);
wind.style.cssText="position:absolute;top:100px;left:100px; background-color:yellow;border:1px solid yellow;z-index:99;width:150px;height:150px;";
document.body.appendChild(wind);
}
点击“知道了”按钮,同时为整个body界面添加一个覆盖页面的 img元素,z-index介于弹窗和原界面之间,点击则removeChild这个img不知楼主能否领会?