• 微课视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
微课江湖
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 微课视频
  • photoshop
  • Fireworks
  • CorelDraw
  • Illustrator
  • Painter
  • Freehand
  • Indesign
  • flash
  • maya
  • autocad
  • 3dmax
您的位置:首页 > 平面设计 >flash > Flash 视频广告的定位兼容性问题

Flash 视频广告的定位兼容性问题

作者:佚名 字体:[增加 减小] 来源:互联网 时间:2017-05-24

佚名 向大家分享了Flash 视频广告的定位兼容性问题,其中包含Flash 视频广告的定位兼容性问题等知识点,遇到此问题的同学们可以参考下
调用代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript" src="flash.js"></script>
<style type="text/css">
body { height:1000px;width:100%}
.zhans_ship { width:250px; height:200px; Z-INDEX:99999; right: 0px; VISIBILITY: hidden; BORDER-BOTTOM: #000 2px solid; POSITION: absolute; BACKGROUND-COLOR: #000;top:378px;}
.top_ship { width:250px; height:26px; background-image:url(kkkk/msgTopBg.gif);font-family:"宋体"; font-size:12px; color:#FFFFFF;}
.top_ship div { width:150px; height:auto; float:left; line-height:20px;}
.bfq_a {font-size: 12px; background-image: url('kkkk/bomBg.gif');height:15px; line-height:15px; color: #ffffff;padding-top:2px; text-align:center;}
.bfq_a a:link { font-family:"宋体"; font-size:12px; text-decoration:none; color:#FFFFFF;}
.bfq_a a:visited { font-family:"宋体"; font-size:12px; text-decoration:none; color:#FFFFFF;}
.bfq_a a:active { font-family:"宋体"; font-size:12px; text-decoration:none; color:#FFFFFF;}
.bfq_a a:hover { font-family:"宋体"; font-size:12px; text-decoration:none; color:#FFFFFF;}
</style>
</head>
<body>
<div class="zhans_ship" id="eMeng">
<div class="top_ship"><div>视频广告:</div><span title=关闭 style="CURSOR: hand;color:white;font-size:12px;font-weight:bold;margin-right:4px; float:right; width:auto; height:auto; margin-top:3px;" onclick=closeDiv() >×</span></div>
<!-- flash 显示部分 start -->
<div class="mid_ship">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 " width="250" height="150">
<param name="movie" value="player.swf">
<param name="quality" value="high">
<param name="allowFullScreen" value="true" />
<param name="FlashVars" value="vcastr_file=http://www.xxx.cn/zhaoshang.flv&vcastr_title=MiningGo&BarColor=0xFFffff&BarPosition=1&IsShowBar=3&BarTransparent=10&LogoText=Zgcjq.COM&IsAutoPlay=1&IsContinue=1" />
<embed src="player.swf" allowFullScreen="true" FlashVars="vcastr_file=http://www.xxx.com/images/zhaoshang.flv&vcastr_title=MiningGo&BarColor=0xFFffff&BarPosition=1&IsShowBar=3&BarTransparent=10&LogoText=Zgcjq.COM&IsAutoPlay=1&IsContinue=1" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer " wmode="transparent" type="application/x-shockwave-flash" width="250" height="150"></embed>
</object>
</div>
<!-- flash 显示部分 end -->
<div class="bfq_a"><a href="#" target="_blank">大型XX活动</a></div>
</div>
</body>
</html>
flash.js代码(修改后的)如下:
if(document.all){
window.attachEvent('onload',getMsg);
}else{
window.addEventListener('load',getMsg,false);
}
window.onresize = resizeDiv;
window.onerror = function(){}
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
try{
var eMeng = document.getElementById("eMeng");
/* 为修改前
var docWidth = document.documentElement.clientWidth;
var docHeight = document.documentElement.clientHeight;
*/
//修改后:
var docWidth = getWidth();
var docHeight = getHeight();
divTop = parseInt(eMeng.style.top,10);
divLeft = parseInt(eMeng.style.left,10);
divHeight = parseInt(eMeng.offsetHeight,10);
divWidth = parseInt(eMeng.offsetWidth,10);
eMeng.style.top = parseInt(document.documentElement.scrollTop,10) + docHeight + 10+"px" ;// divHeight
eMeng.style.left = parseInt(document.documentElement.scrollLeft,10) + docWidth - divWidth+"px" ;
eMeng.style.visibility = "visible";
objTimer = window.setInterval("moveDiv()",10)
}catch(e){
}
}
function resizeDiv()
{
i+=1;
try{
var eMeng = document.getElementById("eMeng");
var docWidth = getWidth();
var docHeight = getHeight();
divHeight = parseInt(eMeng.offsetHeight,10)
divWidth = parseInt(eMeng.offsetWidth,10)
eMeng.style.top = docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)+"px" ;
eMeng.style.left = docWidth - divWidth + parseInt(document.documentElement.scrollLeft,10)+"px" ;
}catch(e){}
}
function moveDiv()
{
try
{
var eMeng = document.getElementById("eMeng");
var docWidth = getWidth();
var docHeight = getHeight();
divHeight = parseInt(eMeng.offsetHeight,10);
divWidth = parseInt(eMeng.offsetWidth,10);
if(parseInt(eMeng.style.top,10) <= (docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)))
{
window.clearInterval(objTimer);
objTimer = window.setInterval("resizeDiv()",1);
}
divTop = parseInt(eMeng.style.top,10);
divTop--;
eMeng.style.top = divTop+"px" ;
}catch(e){
}
}
function closeDiv()
{
var eMeng = document.getElementById("eMeng");
eMeng.innerHTML='';
eMeng.style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer);
}
/**
* 获取屏幕宽度的函数,在非xhtml标准页面下有可能有问题
*/
function getWidth()
{
var winWidth = '';
if (window.innerWidth)//for Firefox
{
winWidth = window.innerWidth;
}
else if((document.body) && (document.body.clientWidth))
{
winWidth = document.body.clientWidth;
}
if (document.documentElement && document.documentElement.clientWidth)
{
winWidth = document.documentElement.clientWidth;
}
return winWidth;
}
/**
* 获取屏幕高度的函数
* html,body高度属性必须设值为height:100%否则在火狐浏览器下获取不到真实高度
*/
function getHeight()
{
var winHeight = '';
if (window.innerHeight)//for Firefox
{
winHeight = window.innerHeight;
}
else if((document.body) && (document.body.clientHeight))
{
winHeight = document.body.clientHeight;
}
if (document.documentElement && document.documentElement.clientHeight)
{
winHeight = document.documentElement.clientHeight;
}
return winHeight;
}
*:红色部分为修改的位置或添加的代码
修改部分:
1.增强型的获取窗口长度和宽度的函数;
2.在style.top,style.left等处在Firefox下必须使用单位px;
3.调整 Flash参数之wmodel,即window model,详情请自己搜索;
修改以上几处,就可以实现IE,Firefox的准确定位和相同的显示效果。 </div>
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

相关文章

  • 2017-05-24Flash 脚本游戏开发教程第三课
  • 2017-05-24关于影片剪辑在主场景中位置修改的Flash技巧
  • 2017-05-24Flash as教程:文字散射效果
  • 2017-05-24Flash实例:简单的弹出菜单演示
  • 2017-05-24Flash AS3.0实例教程:鼠标感应发光的文字旋转效果
  • 2017-05-24FLASH CS3 打造一个小奶瓶图标
  • 2017-05-24SWC让AS3代码更不安全
  • 2017-05-24Flash as3教程:13个Flash as3常用小技巧介绍
  • 2017-05-24Flash CS4来制作漂亮的气泡动画教程
  • 2017-05-24入门:flash的动画制作操作方法

文章分类

  • photoshop
  • Fireworks
  • CorelDraw
  • Illustrator
  • Painter
  • Freehand
  • Indesign
  • flash
  • maya
  • autocad
  • 3dmax

最近更新的内容

    • AS3的GIF播放器及Encoder
    • Flash实例:制作树叶逐渐展开动画
    • flash仿导引线环绕效果加仿球体(图文教程)
    • 阅读swf动画格式文件的简单指导
    • FLASH CTRL+C SHORTCUT IN IE 快捷键在IE中失效
    • FLASH导入声音时提示 读取文件时出现问题该怎么办?
    • FLASH制作一树梨花旋转特效效果图
    • FLASH怎么绘制球按轨迹滚动的动画?
    • FLASH中怎么制作图片连动开合动画效果?
    • Flash制作梦幻仙境动画效果

关于我们 - 联系我们 - 免责声明 - 网站地图

©2015-2018 All Rights Reserved. 微课江湖 版权所有