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

Flash嵌入处:

<iframe style="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">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link type="text/css" href="css/kszcy.css" rel="Stylesheet"/>
<script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="js/jquery.myFocus_kszc.js"></script>
<script type="text/javascript">
//------------判断浏览器-----------
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
var s;
(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>
<body id="flashbody" style="margin-top:0px; margin-left:0px;">
<div id="formAd">
<ul>
<li><a target="_blank" href='#'><img src="flash/1.jpg" alt="" /></a></li>
<li><a target="_blank" href='#'><img src="flash/2.jpg" alt="" /></a></li>
<li><a target="_blank" href='#'><img src="flash/3.jpg" alt="" /></a></li>
<li><a target="_blank" href='#'><img src="flash/4.jpg" alt="" /></a></li>
<li><a target="_blank" href="http://www.pp6.cn/Games/GamesDetail.aspx?ID=6"><img src="flash/5.jpg" alt="" /></a></li>
<li><a target="_blank" href="http://www.pp6.cn/Games/GamesDetail.aspx?ID=5"><img src="flash/6.jpg" alt="" /></a></li>
<li><a target="_blank" href="http://www.pp6.cn/Games/GamesDetail.aspx?ID=4"><img src="flash/7.jpg" alt="" /></a></li>
<li><a target="_blank" href="http://www.pp6.cn/Games/GamesDetail.aspx?ID=7"><img src="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和title
tab="<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); //声明动画函数
function move(){
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);
});
} //更改标题和tab
var 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
});
});

能在手机播放的Flash代码的更多相关文章

  1. Html页面插入flash代码

    转自:http://www.educity.cn/jianzhan/402117.html 转自:http://www.cnblogs.com/yxc_fj/articles/1390621.html ...

  2. 纯css3手机页面图标样式代码

    全部图标:http://hovertree.com/texiao/css/19/ 先看效果: 或者点这里:http://hovertree.com/texiao/css/19/hoverkico.ht ...

  3. Android手机播放电脑视频文件-屌丝必备

    今天早上一到办公室,照常打开博客园看文章,看到有一片文章是用  http://www.cnblogs.com/wdfrog/p/3738180.html 看到这哥们实现的方法好复杂,又是配置电脑端,又 ...

  4. 基于jQuery虾米音乐播放器样式代码

    分享一款基于jQuery虾米音乐播放器样式代码.这是一款基于jquery+html5实现的虾米音乐播放器源码下载.效果图如下: 在线预览   源码下载 实现的代码. html代码: <div c ...

  5. html5播放mp4视频代码

    1.nginx支持flv和mp4格式播放 默认yum安装nginx centos7安装nginx时候应该是默认安装nginx_mod_h264_streaming模块的 # nginx -V查看是否安 ...

  6. EasyDarwin开源手机直播方案:EasyPusher手机直播推送,EasyDarwin流媒体服务器,EasyPlayer手机播放器

    在不断进行EasyDarwin开源流媒体服务器的功能和性能完善的同时,我们也配套实现了目前在安防和移动互联网行业比较火热的移动端手机直播方案,主要就是我们的 EasyPusher直播推送项目 和 Ea ...

  7. EasyDarwin开源手机直播方案:EasyPusher手机直播推送,EasyDarwin流媒体server,EasyPlayer手机播放器

    在不断进行EasyDarwin开源流媒体server的功能和性能完好的同一时候,我们也配套实现了眼下在安防和移动互联网行业比較火热的移动端手机直播方案,主要就是我们的 EasyPusher直播推送项目 ...

  8. zepto手机拼音字母城市选择器代码

    <!doctype html> <html> <head> <meta http-equiv="Content-Type" content ...

  9. Android WebView播放视频flash(判断是否安装flash插件)

    Android WebView播放flash(判断是否安装flash插件)  最近帮一个同学做一个项目,断断续续的一些知识点记录一下.一个页面中有一个WebView,用来播放swf,如果系统中未安装f ...

随机推荐

  1. android学习笔记26——Activity

    Activity ==> android中四大组件:Activity.Service.BroadcastReceiver.ContentProvider Activity组件用于对用户呈现操作界 ...

  2. 浅析:setsockopt()改善socket网络程序的健壮性

    1. 如果在已经处于 ESTABLISHED状态下的socket(一般由端口号和标志符区分)调用closesocket(一般不会立即关闭而经历TIME_WAIT的过程)后想继续重用该socket:BO ...

  3. ios5 中文键盘高度变高覆盖现有ui问题的解决方案(获取键盘高度的方法)(转载)

    背景: ios5之前,iphone上的键盘的高度是固定为216.0px高的,中文汉字的选择框是悬浮的,所以不少应用都将此高度来标注键盘的高度(包括米聊也是这么做的). 可是在ios5中,键盘布局变了, ...

  4. 黄聪:主机宝IIS版ISAPIRewrite伪静态软件操作演示

    下载ISAPIRewrite伪静态破解文件 链接: http://pan.baidu.com/s/1dDEOLl3 密码: yx15 解压到主机宝ISAPIRewrite安装目录即可.如果提示有文件正 ...

  5. 黄聪:C#图片处理封装类(裁剪、缩放、清晰度、加水印、生成缩略图)有示例(转)

    C#图片处理示例(裁剪,缩放,清晰度,水印) 吴剑 2011-02-20 原创文章,转载必需注明出处:http://www.cnblogs.com/wu-jian/ 前言 需求源自项目中的一些应用,比 ...

  6. GL_GL系列 - 多币种管理分析(案例)

    2014-07-08 Created By BaoXinjian

  7. OAF_EO系列7 - OAException异常处理及实现(案例)

    2014-06-12 Created By BaoXinjian

  8. POJ 3984 迷宫问题(BFS)

    迷宫问题 Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, ...

  9. 使ViewStub 来提高UI的加载的性能

    首先看下API中的ViewStub 根据的文档的说明,ViewStub是一种默认不可见的试图,它没有大小,所以不能被改变,也不能通过某些把viewstub添加到布局当中来, 不过我们可以使用infla ...

  10. laravel项目return back()->withErrors($validator)或return back()->with('errors','原密码错误!')在前台原密码错误的情况下不能正确显示错误信息,变成报错!

    被折磨的答案是 php artisan --version看一下版本,如果是5.2.26以上的,在路由处删除web中间件分组,还有问题再反馈