永发信息网

求asp弹出浮动小窗口代码

答案:3  悬赏:50  手机版
解决时间 2021-05-04 08:19
如题。要求打开一个页面时,自动弹出一个小的浮动窗口,大小固定,有关闭按钮即可,主要是发布公告用的。谢谢
最佳答案

不用多说了,看效果吧。。


专门为你放的哦,追点分


http://esxa.cn/eg/



你可以先下载这个文件 http://esxa.cn/eg/ad.js


然后放在你要显示公告的页面相同目录,并写上<script language="JavaScript" type="text/javascript" src="ad.js"></script>



一切OK。。

全部回答

http://share.zcool.com.cn/thread-57705-1-2.html

http://www.lanrentuku.com/down/js/quanping-376/

<html> <head> <title>_xWin</title> <style type='text/css'> <!-- a:visited{text-decoration:none;color:slategray;} a:hover{text-decoration:underline;color:slategray;} a:link{text-decoration:none;color:slategray;} --> </style> <script language=JScript> <!-- //可以打包为js文件; var x0=0,y0=0,x1=0,y1=0; var offx=6,offy=6; var moveable=false; var hover='orange',normal='slategray';//color; var index=10000;//z-index; //开始拖动; function startDrag(obj) { if(event.button==1) { //锁定标题栏; obj.setCapture(); //定义对象; var win = obj.parentNode; var sha = win.nextSibling; //记录鼠标和层位置; x0 = event.clientX; y0 = event.clientY; x1 = parseInt(win.style.left); y1 = parseInt(win.style.top); //记录颜色; normal = obj.style.backgroundColor; //改变风格; obj.style.backgroundColor = hover; win.style.borderColor = hover; obj.nextSibling.style.color = hover; sha.style.left = x1 + offx; sha.style.top = y1 + offy; moveable = true; } } //拖动; function drag(obj) { if(moveable) { var win = obj.parentNode; var sha = win.nextSibling; win.style.left = x1 + event.clientX - x0; win.style.top = y1 + event.clientY - y0; sha.style.left = parseInt(win.style.left) + offx; sha.style.top = parseInt(win.style.top) + offy; } } //停止拖动; function stopDrag(obj) { if(moveable) { var win = obj.parentNode; var sha = win.nextSibling; var msg = obj.nextSibling; win.style.borderColor = normal; obj.style.backgroundColor = normal; msg.style.color = normal; sha.style.left = obj.parentNode.style.left; sha.style.top = obj.parentNode.style.top; obj.releaseCapture(); moveable = false; } } //获得焦点; function getFocus(obj) { if(obj.style.zIndex!=index) { index = index + 2; var idx = index; obj.style.zIndex=idx; obj.nextSibling.style.zIndex=idx-1; } } //最小化; function min(obj) { var win = obj.parentNode.parentNode; var sha = win.nextSibling; var tit = obj.parentNode; var msg = tit.nextSibling; var flg = msg.style.display=="none"; if(flg) { win.style.height = parseInt(msg.style.height) + parseInt(tit.style.height) + 2*2; sha.style.height = win.style.height; msg.style.display = "block"; obj.innerHTML = "0"; } else { win.style.height = parseInt(tit.style.height) + 2*2; sha.style.height = win.style.height; obj.innerHTML = "2"; msg.style.display = "none"; } } //关闭; function cls(obj) { var win = obj.parentNode.parentNode; var sha = win.nextSibling; win.style.visibility = "hidden"; sha.style.visibility = "hidden"; } //创建一个对象; function xWin(id,w,h,l,t,tit,msg) { index = index+2; this.id = id; this.width = w; this.height = h; this.left = l; this.top = t; this.zIndex = index; this.title = tit; this.message = msg; this.obj = null; this.bulid = bulid; this.bulid(); } //初始化; function bulid() { var str = "" + "<div id=xMsg" + this.id + " " + " + "z-index:" + this.zIndex + ";" + "width:" + this.width + ";" + "height:" + this.height + ";" + "left:" + this.left + ";" + "top:" + this.top + ";" + "background-color:" + normal + ";" + "color:" + normal + ";" + "font-size:10px;" + "font-family:Verdana;" + "position:absolute;" + "cursor:default;" + "border:2px solid " + normal + ";" + "' " + "onmousedown='getFocus(this)'>" + "<div " + " + "background-color:" + normal + ";" + "width:" + (this.width-2*2) + ";" + "height:20;" + "color:white;" + "' " + "onmousedown='startDrag(this)' " + "onmouseup='stopDrag(this)' " + "onmousemove='drag(this)' " + "ondblclick='min(this.childNodes)'" + ">" + "<span + (this.width-2*12-4) + ";padding-left:3px;'>" + this.title + "</span>" + "<span onclick='min (this)'>0</span>" + "<span onclick='cls (this)'>r</span>" + "</div>" + "<div + "width:100%;" + "height:" + (this.height-20-4) + ";" + "background-color:white;" + "line-height:14px;" + "word-break:break-all;" + "padding:3px;" + "'>" + this.message + "</div>" + "</div>" + "<div + "width:" + this.width + ";" + "height:" + this.height + ";" + "top:" + this.top + ";" + "left:" + this.left + ";" + "z-index:" + (this.zIndex-1) + ";" + "position:absolute;" + "background-color:black;" + "filter:alpha(opacity=40);" + "'>by wildwind</div>"; document.body.insertAdjacentHTML("beforeEnd",str); } //--> </script> <script language='JScript'> <!-- function initialize() { var a = new xWin("1",160,200,200,200,"Message","xWin <br> A Cool Pop Div Window<br>Version:1.0<br>2002-8-13"); var b = new xWin("2",240,200,100,100,"Wildwind's Msgbox","Welcome to visited my personal website:<br><a href= http://www.webjx.com/ target=_blank> http://www.webjx.com</a><br>and u can also sign my guestbook at:<br><a href= http://www.webjx.com/gbook target=_blank> http://www.webjx.com/gbook thx!!! =)..."); var c = new xWin("3",200,160,250,50,"Copyright","Copyright by <a href='mailto:web@webjx.com'>Wildwind</a>!"); } window.onload = initialize; //--> </script> </head> <body onselectstart='return false' oncontextmenu='return false' scroll='no'> </body> </html>
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
早恋的结果是怎样的
功夫小子在windows7上玩画面好卡咋办???
2010年飞轮海的最新专辑
中国有哪些农业科技园区
600159
奥尼尔什么时候提出 去凯尔特人
中国该向日本下战书了
妈妈宝宝孕婴生活馆怎么去啊,有知道地址的么
一辆自行车赛车要多少钱啊?
为什么总觉得日子过的那么无聊呢??
怎样设置QQ餐厅服务员站在一排
高考古诗词填空集锦,高考语文试卷古诗填空占
NBA2002 EA SPORT 连线功能尚未安装
97娥眉全4石头多少RMB?(区的时间为3个月
手机代收费是什么意思?(急)
推荐资讯
谁有金榜直通模块6英语答案
我妹妹杨雪,想找一个好网名
大家觉得“美特斯邦威”的服饰怎样
谁帮帮我啊啊
开黄钻空间每天可以自动加分吗?
如何关闭球球空间?
浪漫模式怎么跳?
打开鹰击长空时出现saved dump file to是什么
用香水好还是金纺柔顺剂好?
广西峰顺广告装饰有限公司怎么去啊,有知道地
画服装设计图用什么软件比较好?
一轮满月双蛇舞(打一网友名)
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?