时间:2021-05-18
javascript代码,一般放到 head中
复制代码 代码如下:
<Script language="javascript">
<!--
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
//短信提示使用(asilas添加)
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
try{
divTop = parseInt(document.getElementById("eMeng").style.top,10)
divLeft = parseInt(document.getElementById("eMeng").style.left,10)
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
document.getElementById("eMeng").style.visibility="visible"
objTimer = window.setInterval("moveDiv()",10)
}
catch(e){}
}
function resizeDiv()
{
i+=1
//if(i>1300) closeDiv() //客户想不用自动消失由用户来自己关闭所以屏蔽这句
try{
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
}
catch(e){}
}
function moveDiv()
{
try
{
if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
{
window.clearInterval(objTimer)
objTimer = window.setInterval("resizeDiv()",1)
}
divTop = parseInt(document.getElementById("eMeng").style.top,10)
document.getElementById("eMeng").style.top = divTop - 1
}
catch(e){}
}
function closeDiv()
{
document.getElementById('eMeng').innerHTML='';
document.getElementById('eMeng').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer)
}
-->
</Script>
下面的代码放到body中
复制代码 代码如下:
<!--温馨提示代码开始-->
<DIV id=eMeng style="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX:99999; LEFT: 120px; VISIBILITY: hidden; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: 265px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 100px; HEIGHT: 255px; BACKGROUND-COLOR: #c9d3f3">
<TABLE width="265" border=0 cellPadding=0 cellSpacing=0 bgColor=#AFDCF3 style="BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid" style="BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid">
<TR bgColor=#6699cc>
<TD height=24 style="font-size: 12px; background-image: url('msgTopBg.gif'); color: #0f2c8c" style="font-size: 12px; background-image: url('msgTopBg.gif'); color: #0f2c8c">教育的意义</TD>
<TD style="background-image: url('msgTopBg.gif'); padding-right: 2px; padding-top: 2px" style="background-image: url('msgTopBg.gif'); padding-right: 2px; padding-top: 2px" vAlign=center align=right><span title=关闭 style="CURSOR: hand;color:white;font-size:12px;font-weight:bold;margin-right:4px;" style="CURSOR: hand;color:white;font-size:12px;font-weight:bold;margin-right:4px;" onclick=closeDiv() >×</span><!--<IMG title=关闭 style="CURSOR: hand" style="CURSOR: hand" onclick=closeDiv() hspace=3 src="msgClose.jpg" src="msgClose.jpg">--></TD>
</TR>
<TR>
<TD height=225 colSpan=2 align="left" valign="bottom" style="background-image: url('UploadFiles/200510822587734.jpg'); padding-right: 1px; padding-bottom: 1px" style="background-image: url('UploadFiles/200510822587734.jpg'); padding-right: 1px; padding-bottom: 1px"><span style="BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 13px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 13px; FONT-SIZE: 12px; PADDING-BOTTOM: 13px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 18px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%">
<object classid="clsid:05589FA1-C356-11CE-BF01-00AA0055595A" width="239" height="215" id="ActiveMovie1">
<param name="Appearance" value="/0" />
<param name="AutoStart" value="-1" />
<!--控制播放方式: x=1,打开网页自动播放; x=0,按播放键播放。-->
<param name="AllowChangeDisplayMode" value="-1" />
<param name="AllowHideDisplay" value="0" />
<param name="AllowHideControls" value="-1" />
<param name="AutoRewind" value="-1" />
<param name="Balance" value="0" />
<param name="CurrentPosition" value="0" />
<param name="DisplayBackColor" value="0" />
<param name="DisplayForeColor" value="16777215" />
<param name="DisplayMode" value="0" />
<param name="Enabled" value="-1" />
<param name="EnableContextMenu" value="-1" />
<param name="EnablePositionControls" value="-1" />
<param name="EnableSelectionControls" value="0" />
<param name="EnableTracker" value="-1" />
<param name="Filename" value="资源链接地址.mpg" valuetype="ref" />
<!--文件路径-->
<param name="FullScreenMode" value="0" />
<param name="MovieWindowSize" value="0" />
<param name="PlayCount" value="0" />
<!--控制重复次数: “x”为几重复播放几次; x=0,无限循环。-->
<param name="Rate" value="1" />
<param name="SelectionStart" value="-1" />
<param name="SelectionEnd" value="-1" />
<param name="ShowControls" value="-1" />
<param name="ShowDisplay" value="0" />
<param name="ShowPositionControls" value="0" />
<param name="ShowTracker" value="-1" />
<param name="Volume" value="-480" />
</object>
</span></TD>
</TR>
</TABLE>
具体的实现代码测试:
× [Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
复制代码代码如下:javascript读取RSS数据javascript读取RSS数据新闻中心(摘自新浪网)NewsLoading...//Containerf
用page.ClientScript.RegisterStartupScript方式实现代码为:复制代码代码如下://////弹出JavaScript小
效果图如下所示:JS实现微信弹出搜索框多条件查询功能的实现代码如下所示:百望云票#kongzhi{position:relative;left:-20px;to
IOS开发之ios视频截屏的实现代码现在好多视频截屏软件,这里提供一个IOS视频截屏的方法,大家可以参考下,实现代码:?12345678910111213141
js获取新浪天气接口的实现代码天气functionshowLocale(objD){varstr,colorhead,colorfoot;varyy=objD.