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="/UploadFiles/2021-04-02/msgClose.jpg"></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需再刷新一下页面才能执行]
标签:
新浪网,弹出视频

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com

评论“类似新浪网的 弹出视频功能实现代码”

暂无“类似新浪网的 弹出视频功能实现代码”评论...

RTX 5090要首发 性能要翻倍!三星展示GDDR7显存

三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。

首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。

据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。