有些使用Flash的广告图片变换代码在手机不支持,在网上搜到了一个解决的方法:

Flash嵌入处:

<iframestyle="width:474px;height:276px; border:0;"scrolling="no"src="flash.htm" ></iframe>

flash.htm:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml">
<head><title></title><linktype="text/css"href="css/kszcy.css"rel="Stylesheet"/><scripttype="text/javascript"src="js/jquery-1.5.2.min.js"></script><scripttype="text/javascript"src="js/jquery.myFocus_kszc.js"></script><scripttype="text/javascript">//------------判断浏览器-----------varSys={};varua=navigator.userAgent.toLowerCase();vars;(s=ua.match(/msie ([\d.]+)/))?Sys.ie=s[1] :(s=ua.match(/firefox\/([\d.]+)/))?Sys.firefox=s[1] :(s=ua.match(/chrome\/([\d.]+)/))?Sys.chrome=s[1] :(s=ua.match(/opera.([\d.]+)/))?Sys.opera=s[1] :(s=ua.match(/version\/([\d.]+).*safari/))?Sys.safari=s[1] :0;//------------判断浏览器-----------
$(function() {try{if(Sys.ie) {$("#flashbody").css("margin-top","-4").css("margin-left","-4");}else{}}catch(e) { }});</script>
</head>
<bodyid="flashbody"style="margin-top:0px; margin-left:0px;"><divid="formAd"><ul>             <li><atarget="_blank"href='#'><imgsrc="flash/1.jpg"alt="" /></a></li>                                   <li><atarget="_blank"href='#'><imgsrc="flash/2.jpg"alt="" /></a></li>                  <li><atarget="_blank"href='#'><imgsrc="flash/3.jpg"alt="" /></a></li>  <li><atarget="_blank"href='#'><imgsrc="flash/4.jpg"alt="" /></a></li> <li><atarget="_blank"href="http://www.pp6.cn/Games/GamesDetail.aspx?ID=6"><imgsrc="flash/5.jpg"alt="" /></a></li>  <li><atarget="_blank"href="http://www.pp6.cn/Games/GamesDetail.aspx?ID=5"><imgsrc="flash/6.jpg"alt="" /></a></li>  <li><atarget="_blank"href="http://www.pp6.cn/Games/GamesDetail.aspx?ID=4"><imgsrc="flash/7.jpg"alt="" /></a></li>  <li><atarget="_blank"href="http://www.pp6.cn/Games/GamesDetail.aspx?ID=7"><imgsrc="flash/8.jpg"alt="" /></a></li>        </ul></div>
</body>
</html>

kszcy.css:

/*由开发人员工具生成。它可能不是原始源文件的准确表示形式。*/#formAd UL{MARGIN:0px;padding:0px;
}#formAdLI{MARGIN:0px;padding:0px;
}#formAd A{COLOR:#fff;CURSOR:pointer;TEXT-DECORATION:none}#formAd A:hover{COLOR:#fff9a0}#formAd IMG{VERTICAL-ALIGN:middle;
}#formAd{WIDTH:474px;HEIGHT:276px;OVERFLOW:hidden;
}#formAd LI{WIDTH:474px;DISPLAY:inline;FLOAT:left;HEIGHT:276px;OVERFLOW:hidden}#formAd LI IMG{WIDTH:474px;HEIGHT:276px}.focusNum{POSITION:absolute;top:250px;left:370px}.focusNum SPAN{TEXT-ALIGN:center;LINE-HEIGHT:18px;BACKGROUND-COLOR:#b7d8ff;MARGIN:0px 3px;WIDTH:18px;DISPLAY:inline-block;HEIGHT:18px;CURSOR:pointer}.focusNum SPAN.curr{BACKGROUND-COLOR:#3086eb;COLOR:#ffffff}.focusTit{DISPLAY:none}

jquery.myFocus_kszc.js:

   (function($) {$.fn.myFocus= function(options) {//默认配置var defaults ={width:474,height:276,animation:"defaults",times:5000};//覆盖默认配置var opts =$.extend(defaults, options);var setId=[];//开始this.each(function(i){var $this=$(this),$list=$this.find("ul > li"),$ul=$this.find("ul"),imgnum=$list.size(),firstTxt=$list.eq(0).find("a").attr("title"),tab;//显示tab和titletab="<div class='focusNum'>";for(var i=0;i<imgnum;i++){if(i==0){tab+="<span href='#' class='curr'>"+(i+1)+"</span>";}else{tab+="<span href='#'>"+(i+1)+"</span>"; }}tab+="</div>";       $this.append(tab).append($("<p class='focusTit'>"+firstTxt+"</p>"))//设置宽度和高度
.css({width:opts.width,height:opts.height}).find("ul").css({width:opts.width*imgnum,height:opts.height}).find("li").css({width:opts.width,height:opts.height});$list.each(function(index){$(this).data("index",index);});$this.data("currFocus",0);//声明动画函数functionmove(){setId[i]=setInterval(function(){$.fn.myFocus.animation[opts.animation]($this,opts);},opts.times);}//开始动画
move();var $tab=$this.find("div > span") ,$title=$this.find("p");//鼠标经过tab$tab.hover(function(){clearInterval(setId[i]);var index=$tab.index($(this));$this.data("currFocus",index);$ul.stop(true,true).animate({"margin-left":-opts.width*index},500);$tab.removeClass("curr");$(this).addClass("curr");var currList=$list.eq(index);  $title.text(currList.find("a").attr("title"));},function(){move();    });//鼠标经过图片$ul.hover(function(){clearInterval(setId[i]);},function(){move();     });});};//动画函数-------$.fn.myFocus.animation={defaults:function($this,opts){var $ul=$this.find("ul"),_this=this,$list=$this.find("ul>li"),$tab=$this.find("div > span"),$title=$this.find("p"),imgNum=$list.size(),curtab=$this.data("currFocus");if(curtab<imgNum-1){  $this.data("currFocus",curtab+1);$ul.animate({"margin-left": '-='+opts.width},500);}else{curtab=-1;$ul.animate({"margin-left": '0px'},500,function(){$this.data("currFocus",0);});}//更改标题和tabvar currList=$list.eq(curtab+1);  $title.text(currList.find("a").attr("title"));index=currList.data("index");//图片过渡效果//currList.animate({//opacity: 0.25//},500, function() {//$(this).fadeTo('slow',1);//});
$tab.removeClass("curr").eq(index).addClass("curr");}};})(jQuery); $(function(){$("#formAd").myFocus({width:474,height:276,times:3000});
});

转载于:https://www.cnblogs.com/vinsonLu/p/4118214.html

能在手机播放的Flash代码相关推荐

  1. 能在手机播放的视频代码

    本文转载自: https://www.cnblogs.com/vinsonlu/p/4103188.html 作者:vinsonLu 转载请注明该声明. 一些网页会有视频的嵌套窗口,在电脑上可以播放, ...

  2. 移动端html如何加载优酷视频,网站怎么引用优酷腾讯视频并支持手机播放

    网站上引用一些视频,如何让这些视频既支持电脑播放,又支持手机播放,我们可以通过 iframe 调用的方式来解决这个问题. 首先让我们来了解一下嵌入窗体: iframe属性: allowtranspar ...

  3. Edge 浏览器有秘密白名单,允许 Facebook 运行 Flash 代码

    开发四年只会写业务代码,分布式高并发都不会还做程序员?   Microsoft Edge 浏览器包含了一个秘密的白名单,允许 Facebook 运行 Adobe Flash 代码.白名单允许 Face ...

  4. android 小米手机播放短小音频无声音问题

    最近,在给在给一个页面添加声音效果时,发现小米手机播放不了声音,发现其他机型可以播放 ,在此发现两种解决办法: 第一种,可以在小米手机设置中解决: 设置---声音和震动 -–音量--媒体音量,音乐,视 ...

  5. android 5.0播放swf flash源码Demo

    android 5.0播放swf flash源码Demo 安卓5.0flash播放源码 android flash 播放器 swf 由于之前webview方法播放flash在新的系统中不可用.所以so ...

  6. 在html里面加入flash,如何在HTML页面插入flash代码

    如何在HTML页面插入flash代码 swliveconnect 属性 值: true | false 说明: (可选)指定第一次加载 Flash Player 时浏览器是否应启动 Java.如果忽略 ...

  7. 网页播放视频解决代码(来自百度知道)

    有5种方法 1.最通用的标签是: <embed src="文件名"> 其中文件名可以取任何一种多媒体文件格式,例如 "a.wma",就会在网页上显示 ...

  8. html网页转换swf格式,[转]html网页 swf播放器使用代码

    可加装广告的swf播放器JS代码 加载flash动画前可以加载代码,设定广告显示秒数这些,还有些小bug,等有空了修复好法上来给大家​​ 1. [代码][Java]代码/p> (原创)jQuer ...

  9. FLASH代码初级教程

    1 FLASH代码初级教程   前几个都是我贴的整理到一个帖子里大家看着方便 本文转自 http://coolcodes.cn/bencandy.php?fid-5-id-24-page-1.htm ...

最新文章

  1. java final 实例_Java中final实现原理的深入分析(附示例)
  2. 【排序算法】——图解双轴快排(建议收藏)
  3. 内部类访问局部变量的时候,为什么变量必须加上final修饰
  4. WCF服务寄宿IIS与Windows服务 - C#/.NET
  5. 单个正态总体均值的区间估计_统计概率之误差思维:置信区间
  6. 最长单调递增子序列 [转]
  7. C++自学07:字符串(char/string/wchar_t/char16_t/char32_t)
  8. Postgres 数据库大批量单表导入数据引发性能故障的处理
  9. 如何实现手动指定AOP实现JDK代理模式到CGLIB的更改?
  10. 在Android浏览器下字体偏上的问题
  11. 鸟哥的 linux 的私房菜 基础学习篇,鸟哥的 Linux 私房菜 -- 基础学习篇
  12. HDU 6070 Dirt Ratio
  13. vue中使用video插件在微信浏览器中视频无法自动播放的问题
  14. Android x86 镜像 安装到 PC 机上
  15. 获取classpath(src/main/resources)的绝对路径
  16. UGUI事件系统——事件接口
  17. asp.net消除锯齿的办法
  18. 虚拟机由于硬盘存储空间过满导致启动异常+虚拟机扩容
  19. 怎么做读书分享PPT课件?
  20. 叠氮功能化硫铟铜量子点CuInS Qds-N3|炔基修饰碲化镉/硫化硒量子点 CdTe/CdSe Qds-Alkyne科研试剂

热门文章

  1. oracle数据库同步异步优劣点,ORACLE数据库异步IO介绍
  2. java 乘法 位移_Java:移位实现的乘除法
  3. python中yield的使用_python中yield的用法详解-转载
  4. Python用类求圆的周长面积与球的表面积体积
  5. 测试面试题集-生活物品测试:杯子、伞、钢笔、桌子
  6. 性能测试(三)Jmeter工具
  7. java快捷输入:IDEA
  8. 链上结构化产品Ribbon将推出基于看跌期权的资管产品Puts Theta Vault
  9. SAP License:关于SAP 对生产订单的月度结算
  10. SAP License:你适合做SAP顾问吗?