用js实现的一个Flash滚动轮换显示图片代码生成器

所属分类: 网络编程 / JavaScript 阅读数: 552
收藏 0 赞 0 分享
复制代码 代码如下:

<!--文件头模板-->
<SCRIPT src=top.js></SCRIPT>
<SCRIPT language=javascript>
    writeTop('Flash滚动显示图片代码生成','2006-10-18');
</SCRIPT>

<!--以下为内容-->
<SCRIPT>
//运行代码
function runEx(cod1)  {
     cod=document.getElementById(cod1)
      var code=cod.value;
      if (code!=""){
          var newwin=window.open('','','');  
          newwin.opener = null 
          newwin.document.write(code);  
          newwin.document.close();
    }
}
//复制代码
function doCopy(ID) { 
    if (document.all){
         textRange = document.getElementById(ID).createTextRange(); 
         textRange.execCommand("Copy"); 
    }
    else{
         alert("此功能只能在IE上有效")
    }
}

//展开_收起段落
function close_open(theID){
    if(document.getElementById(theID).style.display!='none') {
        document.getElementById(theID).style.display='none';
    }
    else 
        document.getElementById(theID).style.display='block';
}
</SCRIPT>

<SCRIPT language=javascript>
    //生成代码
    function genCode()
    {
        var html='';
        var picUrl='';
        var picLink='';
        var picTitle='';
        var picWidth=0;
        var picHeight=0;
        var titleHeight=0;
        var backgroudn='';

        {
            var tempUrl='';
            var tempLink='';
            var tempTitle='';
            for(i=0;i<9;++i){
                tempUrl=document.getElementById('picUrl_'+(1+i)).value;
                tempLink=document.getElementById('picLink_'+(1+i)).value;
                tempTitle=document.getElementById('picTitle_'+(1+i)).value;
                if(tempUrl == '')continue;
                if(tempLink == '')tempLink=tempUrl;
                if(tempTitle == '')tempTitle='无题';
                picUrl   += tempUrl + '|';
                picLink  += tempLink + '|';
                picTitle += tempTitle + '|';
            }
            picUrl = picUrl.substring(0,picUrl.length-1);
            picTitle = picTitle.substring(0,picTitle.length-1);
            picLink = picLink.substring(0,picLink.length-1);
            picWidth = parseInt(document.getElementById('picWidth').value);
            picHeight=parseInt(document.getElementById('picHeight').value);
            titleHeight = parseInt(document.getElementById('titleHeight').value);
            backgroudn = document.getElementById('backgroudn').value;
        }

        html += '<EMBED pluginspage=http://www.macromedia.com/go/getflashplayer src=http://staryxy.googlepages.com/PicPlay.swf';
        html += ' width='  + picWidth;
        html += ' height=' + (picHeight + titleHeight);
        html += ' type=application/x-shockwave-flash WMODE="opaque" FLASHVARS="';
        html += 'pics='+picUrl;
        html += '&amp;links='+picLink;
        html += '&amp;texts='+picTitle;
        html += '&amp;borderwidth=' + picWidth;
        html += '&amp;borderheight=' + picHeight;
        html += '&amp;textheight=' + titleHeight;
        html += '" MENU="false"';
        html += ' BGCOLOR="' + backgroudn;
        html += '" QUALITY="high" ALLOWSCRIPTACCESS="sameDomain"></EMBED>';

        document.getElementById('ShowCode').value = html;
        show.innerHTML = html;
    }
</SCRIPT>

<div style="margin-top:5px;background:#9abcde">
<div style='cursor:hand' onclick=close_open('edit')><li>设置</li></div>
<div id='edit' style="margin-left:15px; display:block;">
    <div style="background:#cdcdcd">
        图片显示宽度:<input size=10 id=picWidth   title="图片显示宽度" value="300"></input>
        图片显示高度:<input size=10 id=picHeight  title="图片显示高度" value="200"></input>
        文字区域高度:<input size=10 id=titleheight title="文字区域高度" value="20"></input>
        背景色:<input size=10 id=backgroudn title="背景色" value='#cdcdcd'></input>
    </div>
    <div style="background:#eeeeee">
        图片一:
        <input maxlength=2048 size=25 id=picUrl_1 value="http://staryxy.googlepages.com/diner1.jpg" title="图片URL地址"></input>
        链接地址:<input maxlength=2048 size=25 id=picLink_1 value="" title="链接地址"></input>
        说明:<input maxlength=2048 size=20 id=picTitle_1 value="「夜宴」搞恶图片1" title="说明"></input>
    </div>
    <div style="background:#cdcdcd">
        图片二:
        <input maxlength=2048 size=25 id=picUrl_2 value="http://staryxy.googlepages.com/diner2.jpg" title="图片URL地址"></input>
        链接地址:<input maxlength=2048 size=25 id=picLink_2 value="" title="链接地址"></input>
        说明:<input maxlength=2048 size=20 id=picTitle_2 value="「夜宴」搞恶图片2" title="说明"></input>
    </div>
    <div style="background:#eeeeee">
        图片三:
        <input maxlength=2048 size=25 id=picUrl_3 value="http://staryxy.googlepages.com/diner4.jpg" title="图片URL地址"></input>
        链接地址:<input maxlength=2048 size=25 id=picLink_3 value="" title="链接地址"></input>
        说明:<input maxlength=2048 size=20 id=picTitle_3 value="「夜宴」搞恶图片3" title="说明"></input>
    </div>
    <div style="background:#cdcdcd">
        图片四:
        <input maxlength=2048 size=25 id=picUrl_4 value="http://staryxy.googlepages.com/diner7.jpg" title="图片URL地址"></input>
        链接地址:<input maxlength=2048 size=25 id=picLink_4 value="" title="链接地址"></input>
        说明:<input maxlength=2048 size=20 id=picTitle_4 value="「夜宴」搞恶图片4" title="说明"></input>
    </div>
    <div style="background:#eeeeee">
        图片五:
        <input maxlength=2048 size=25 id=picUrl_5 value="http://staryxy.googlepages.com/diner8.jpg" title="图片URL地址"></input>
        链接地址:<input maxlength=2048 size=25 id=picLink_5 value="" title="链接地址"></input>
        说明:<input maxlength=2048 size=20 id=picTitle_5 value="「夜宴」搞恶图片5" title="说明"></input>
    </div>
    <div style="background:#cdcdcd">
        图片六:
        <input maxlength=2048 size=25 id=picUrl_6 value="http://staryxy.googlepages.com/diner12.jpg" title="图片URL地址"></input>
        链接地址:<input maxlength=2048 size=25 id=picLink_6 value="" title="链接地址"></input>
        说明:<input maxlength=2048 size=20 id=picTitle_6 value="「夜宴」搞恶图片6" title="说明"></input>
    </div>
    <div style='cursor:hand' onclick=close_open('editmore')><li>更多(推荐6张以下,否则说明将看不到)</li></div>
    <div id='editmore' style='display:none;'>
        <div style="background:#eeeeee">
            图片七:
            <input maxlength=2048 size=25 id=picUrl_7 value="" title="图片URL地址"></input>
        链接地址:<input maxlength=2048 size=25 id=picLink_7 value="" title="链接地址"></input>
        说明:<input maxlength=2048 size=20 id=picTitle_7 value="" title="说明"></input>
        </div>
        <div style="background:#cdcdcd">
            图片八:
            <input maxlength=2048 size=25 id=picUrl_8 value="" title="图片URL地址"></input>
        链接地址:<input maxlength=2048 size=25 id=picLink_8 value="" title="链接地址"></input>
        说明:<input maxlength=2048 size=20 id=picTitle_8 value="" title="说明"></input>
        </div>
        <div style="background:#eeeeee">
            图片九:
            <input maxlength=2048 size=25 id=picUrl_9 value="" title="图片URL地址"></input>
        链接地址:<input maxlength=2048 size=25 id=picLink_9 value="" title="链接地址"></input>
        说明:<input maxlength=2048 size=20 id=picTitle_9 value="" title="说明"></input>
        </div>
    </div>
</div>
<div>
    <input type=button onclick='javascript:genCode();' value=生成代码>
    </input>
</div>
</div>


<div style="margin-top:5px;background:#9abcde">
<div onclick=close_open('code')  style='cursor:hand'><li>代码</li></div>
<div id='code' style='margin-left:15px;display:none;'>
<TEXTAREA rows="15" id="ShowCode" style="width:100%">
<!--此处显示结果代码-->
</TEXTAREA>
</div>
<div>
    <INPUT onclick="runEx('ShowCode')"  type="button" value="运行此代码"/>
    <INPUT onclick="doCopy('ShowCode')"  type="button" value="复制此代码"/>
    [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
</div>
</div>



<div style="margin-top:5px;background:#9abcde;">
    <div onclick=close_open('show')  style='cursor:hand'><li>显示效果</li></div>
    <div id='show' title="显示效果" align=center style="margin-left:15px;display:none;background:#abcdef">
    还没有
    </div>
</div>
</div>
更多精彩内容其他人还在看

layui table 复选框跳页后再回来保持原来选中的状态示例

今天小编就为大家分享一篇layui table 复选框跳页后再回来保持原来选中的状态示例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
收藏 0 赞 0 分享

Vue-Cli项目优化操作的实现

这篇文章主要介绍了Vue-Cli项目优化操作,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
收藏 0 赞 0 分享

解决包含在label标签下的checkbox在ie8及以下版本点击事件无效果兼容的问题

这篇文章主要介绍了解决包含在label标签下的checkbox在ie8及以下版本点击事件无效果兼容的问题,本文给大家总结的非常详细,需要的朋友可以参考下
收藏 0 赞 0 分享

vue 父组件通过v-model接收子组件的值的代码

这篇文章主要介绍了vue 父组件通过v-model接收子组件的值的代码,代码简单易懂,非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下
收藏 0 赞 0 分享

vue 全局环境切换问题

小编在开发使经常会碰到全局切换问题,今天小编给大家带来一篇教程给大家介绍vue 全局环境切换问题,感兴趣的朋友一起看看吧
收藏 0 赞 0 分享

element-ui 本地化使用教程详解

这篇文章主要介绍了element-ui 本地化使用教程详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
收藏 0 赞 0 分享

在Vue项目中,防止页面被缩放和放大示例

今天小编就为大家分享一篇在Vue项目中,防止页面被缩放和放大示例,具有很好的参考 价值,希望对大家有所帮助。一起跟随小编过来看看吧
收藏 0 赞 0 分享

vue h5移动端禁止缩放代码

今天小编就为大家分享一篇vue h5移动端禁止缩放代码,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
收藏 0 赞 0 分享

Vue 3.0双向绑定原理的实现方法

这篇文章主要为大家详细介绍了Vue 3.0双向绑定原理的实现方法,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

nest.js 使用express需要提供多个静态目录的操作方法

这篇文章主要介绍了nest.js 使用express需要提供多个静态目录的操作,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
收藏 0 赞 0 分享
查看更多