flash焦点图效果slide.swf体积超小,调用方便

模板网 2014-09-25

flash焦点图效果slide.swf体积超小,调用方便,swf文件大小只有10K,图片随机切换效果。

代码打包下载:flash焦点图效果slide.swf体积超小,调用方便

效果截图:

flash焦点图效果slide.swf体积超小,调用方便

代码解释:

复制代码 代码如下:
<script language="javascript">
    linkarr = new Array(); //定义图片链接数组
    picarr = new Array(); //定义图片地址数组
    textarr = new Array(); //定义图片标题数组
    var focus_width = 420; //设置图片宽度
    var focus_height = 300; //设置图片高度
    var text_height = 0; //设置文字高度
    var pics = "";
    var links = "";
    var texts = "";
    var swf_height = focus_height + text_height;
    var defJpeg = "/demo/20140925/002/images/default.jpg"; //默认图片,图片加载失败时显示该图片
    //这里设置调用标记
    linkarr[1] = "#1";
    picarr[1] = "/demo/20140925/002/images/1.jpg";
    textarr[1]="";
    linkarr[2] = "#2";
    picarr[2] = "/demo/20140925/002/images/2.jpg";
    textarr[2]="";
    linkarr[3] = "#3";
    picarr[3] = "/demo/20140925/002/images/3.jpg";
    textarr[3]="";
   /*以上代码作用是将图片链接,图片地址,图片标题分别添加到对应的数组中,可继续添加 数组下标以此类推 linkarr[4]、picarr[4] 、 textarr[4]*/
    for (i = 1; i < picarr.length; i++) {
        if (picarr[i].indexOf("jpg") == -1 && picarr[i].indexOf("JPG") == -1) picarr[i] = defJpeg;
        if (pics == "") pics = picarr[i];
        else pics += "|" + picarr[i];
    }
 
    for (i = 1; i < linkarr.length; i++) {
        if (links == "") links = linkarr[i];
        else links += "|" + linkarr[i];
    }
 
    for (i = 1; i < textarr.length; i++) {
        if (texts == "") texts = textarr[i];
        else texts += "|" + textarr[i];
    }
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + focus_width + '" height="' + swf_height + '">');
    document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/demo/20140925/002/slide.swf">');
    document.write('<param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
    document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
    document.write('<param name="FlashVars" value="pics=' + pics + '&links=' + links + '&texts=' + texts + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '">');
    document.write('<embed src="/demo/20140925/002/slide.swf" wmode="opaque" FlashVars="pics=' + pics + '&links=' + links + '&texts=' + texts + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '" menu="false" bgcolor="#ffffff" quality="high" width="' + focus_width + '" height="' + focus_height + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
</script>
&lt;title&gt;flash焦点图效果slide.swf体积超小,调用方便&lt;/title&gt;
&lt;script language=&quot;javascript&quot;&gt;
    linkarr = new Array();
    picarr = new Array();
    textarr = new Array();
    var focus_width = 420;
    var focus_height = 300;
    var text_height = 0;
    var pics = &quot;&quot;;
    var links = &quot;&quot;;
    var texts = &quot;&quot;;
    var swf_height = focus_height + text_height;
    var defJpeg = &quot;/demo/20140925/002/images/default.jpg&quot;;
    //这里设置调用标记
    linkarr[1] = &quot;#1&quot;;
    picarr[1] = &quot;/demo/20140925/002/images/1.jpg&quot;;
    linkarr[2] = &quot;#2&quot;;
    picarr[2] = &quot;/demo/20140925/002/images/2.jpg&quot;;
    linkarr[3] = &quot;#3&quot;;
    picarr[3] = &quot;/demo/20140925/002/images/3.jpg&quot;;

    for (i = 1; i &lt; picarr.length; i++) {
        if (picarr[i].indexOf(&quot;jpg&quot;) == -1 &amp;&amp; picarr[i].indexOf(&quot;JPG&quot;) == -1) picarr[i] = defJpeg;
        if (pics == &quot;&quot;) pics = picarr[i];
        else pics += &quot;&#124;&quot; + picarr[i];
    }

    for (i = 1; i &lt; linkarr.length; i++) {
        if (links == &quot;&quot;) links = linkarr[i];
        else links += &quot;&#124;&quot; + linkarr[i];
    }

    for (i = 1; i &lt; textarr.length; i++) {
        if (texts == &quot;&quot;) texts = textarr[i];
        else texts += &quot;&#124;&quot; + textarr[i];
    }
    document.write(&#039;&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; codebase=&quot;http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0&quot; width=&quot;&#039; + focus_width + &#039;&quot; height=&quot;&#039; + swf_height + &#039;&quot;&gt;&#039;);
    document.write(&#039;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;sameDomain&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;/demo/20140925/002/slide.swf&quot;&gt;&#039;);
    document.write(&#039;&lt;param name=&quot;quality&quot; value=&quot;high&quot;&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot;&gt;&#039;);
    document.write(&#039;&lt;param name=&quot;menu&quot; value=&quot;false&quot;&gt;&lt;param name=wmode value=&quot;opaque&quot;&gt;&#039;);
    document.write(&#039;&lt;param name=&quot;FlashVars&quot; value=&quot;pics=&#039; + pics + &#039;&amp;links=&#039; + links + &#039;&amp;texts=&#039; + texts + &#039;&amp;borderwidth=&#039; + focus_width + &#039;&amp;borderheight=&#039; + focus_height + &#039;&amp;textheight=&#039; + text_height + &#039;&quot;&gt;&#039;);
    document.write(&#039;&lt;embed src=&quot;/demo/20140925/002/slide.swf&quot; wmode=&quot;opaque&quot; FlashVars=&quot;pics=&#039; + pics + &#039;&amp;links=&#039; + links + &#039;&amp;texts=&#039; + texts + &#039;&amp;borderwidth=&#039; + focus_width + &#039;&amp;borderheight=&#039; + focus_height + &#039;&amp;textheight=&#039; + text_height + &#039;&quot; menu=&quot;false&quot; bgcolor=&quot;#ffffff&quot; quality=&quot;high&quot; width=&quot;&#039; + focus_width + &#039;&quot; height=&quot;&#039; + focus_height + &#039;&quot; allowScriptAccess=&quot;sameDomain&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; /&gt;&#039;);
    document.write(&#039;&lt;/object&gt;&#039;);
&lt;/script&gt;

相关文章

  1. 纯JS写的右下角QQ抖动效果

    纯JS写的右下角QQ抖动效果,代码简单容易理解修改。 复制代码 代码如下: script /*** 窗口抖动 ***/ function shake(){ var a=[bottom,right],b=0; var u=setInterval(function(){ document.getElementById(lovexin1).style[a[b%2]]=(b++)%42?0:4 + px; if(b

  2. JS高级Marquee代码

    JS高级Marquee代码 创建实例: //参数直接赋值法 new Marquee(marquee) new Marquee(marquee,top) ...... new Marquee(marquee,0,1,760,52) new Marquee(marquee,top,1,760,52,50,5000) ...... new Marquee(marquee,0,1,760,104,50,5000,3000,52) new Marquee

  3. flash焦点图效果slide.swf体积超小,调用方便

    flash焦点图效果slide.swf体积超小,调用方便,swf文件大小只有10K,图片随机切换效果。 代码打包下载: flash焦点图效果slide.swf体积超小,调用方便 效果截图: 代码解释: 复制代码 代码如下: script language=javascript linkarr = new Array(); //定义

  4. 非常简洁的网页Tab效果setTab

    网页上使用频率最高的Tab标签效果,封装成了一个setTab函数,使用方法非常简单。 setTab函数完整代码: 复制代码 代码如下: script function setTab(name, cursel, n) { for (i = 1; i = n; i++) { var menu = document.getElementById(name + i); var con =

  5. 仿患者咨询平台效果

    仿患者咨询平台效果,模拟患者提问专家回复效果,吸引患者点击咨询,测试表明点击率非常高。 修改问答数据可修改js/data.js文件,问答数据已json数组形式保存。 在线演示: 仿患者咨询平台效果 下载地址: 仿患者咨询平台效果 效果截图: 展开效果 收起效果

随机推荐

  1. 纯JS写的右下角QQ抖动效果

    纯JS写的右下角QQ抖动效果,代码简单容易理解修改。 复制代码 代码如下: script /*** 窗口抖动 ***/ function shake(){ var a=[bottom,right],b=0; var u=setInterval(function(){ document.getElementById(lovexin1).style[a[b%2]]=(b++)%42?0:4 + px; if(b

  2. JS高级Marquee代码

    JS高级Marquee代码 创建实例: //参数直接赋值法 new Marquee(marquee) new Marquee(marquee,top) ...... new Marquee(marquee,0,1,760,52) new Marquee(marquee,top,1,760,52,50,5000) ...... new Marquee(marquee,0,1,760,104,50,5000,3000,52) new Marquee

  3. flash焦点图效果slide.swf体积超小,调用方便

    flash焦点图效果slide.swf体积超小,调用方便,swf文件大小只有10K,图片随机切换效果。 代码打包下载: flash焦点图效果slide.swf体积超小,调用方便 效果截图: 代码解释: 复制代码 代码如下: script language=javascript linkarr = new Array(); //定义

  4. 非常简洁的网页Tab效果setTab

    网页上使用频率最高的Tab标签效果,封装成了一个setTab函数,使用方法非常简单。 setTab函数完整代码: 复制代码 代码如下: script function setTab(name, cursel, n) { for (i = 1; i = n; i++) { var menu = document.getElementById(name + i); var con =

  5. 仿患者咨询平台效果

    仿患者咨询平台效果,模拟患者提问专家回复效果,吸引患者点击咨询,测试表明点击率非常高。 修改问答数据可修改js/data.js文件,问答数据已json数组形式保存。 在线演示: 仿患者咨询平台效果 下载地址: 仿患者咨询平台效果 效果截图: 展开效果 收起效果