html:
js:
function hideThis() {hide = setInterval("changeH('down')", 2);//开始以每0.002秒调用函数changeH("down"),即每0.002秒向下移动一次
}function changeH(str) {var MsgPop &#61; document.getElementById("winpop");var popH &#61; parseInt(MsgPop.style.height);if (str &#61;&#61; "up") { //如果这个参数是UPif (popH <&#61; 100) { //如果转化为数值的高度小于等于100MsgPop.style.height &#61; (popH &#43; 4).toString() &#43; "px";//高度增加4个象素
}else {clearInterval(show);//否则就取消这个函数调用,意思就是如果高度超过100象度了,就不再增长了
}}if (str &#61;&#61; "down") {//if (popH >&#61; 4) { //如果这个参数是down// MsgPop.style.height &#61; (popH - 4).toString() &#43; "px";//那么窗口的高度减少4个象素//}//else { //否则clearInterval(hide); //否则就取消这个函数调用,意思就是如果高度小于4个象度的时候,就不再减了MsgPop.style.display &#61; "none"; //因为窗口有边框,所以还是可以看见1~2象素没缩进去,这时候就把DIV隐藏掉//}
}}
setInterval("tips_pop()", 3000);//1分钟一次window.onload &#61; function () { //加载document.getElementById(&#39;winpop&#39;).style.height &#61; &#39;0px&#39;;}function tips_pop() {debugger;var MsgPop &#61; document.getElementById("winpop");//获取窗口这个对象,即ID为winpop的对象var popH &#61; parseInt(MsgPop.style.height);//用parseInt将对象的高度转化为数字,以方便下面比较if (popH &#61;&#61; 0) { //如果窗口的高度是0$.post("GetDateList.ashx", function (data) {data &#61; JSON.parse(data);if (data !&#61; "") {var content &#61; "
}$("#divEquipment").html(divEquipment);//if (data.DeviceCode !&#61; undefined && data.DeviceCode !&#61; "") {MsgPop.style.display &#61; "block";//那么将隐藏的窗口显示出来show &#61; setInterval("changeH(&#39;up&#39;)", 2);//开始以每0.002秒调用函数changeH("up"),即每0.002秒向上移动一次
play_click();//}
}});}}
//提示音乐
function play_click() {
var au &#61; document.createElement("audio");
au.preload &#61; "auto";
au.src &#61; "../../Images/message.mp3";
au.play();
}function OpenDetail() {layer.open({type: 1,shadeClose: true,title: &#39;设备编号&#39;,zIndex: 10,area: [&#39;460px&#39;, &#39;360px&#39;], //宽高content: $("#divEquipment")});}function reloadEquipment(DeviceId) {window.open(url);}
css&#xff1a;
需要引用的js文件&#xff1a;
最终效果图&#xff1a;
查看详情效果图 &#xff1a;