zoukankan      html  css  js  c++  java
  • 图片切换

     <script type="text/javascript">

            var bannerAD = new Array();
            var bannerADlink = new Array();
            var adNum = 0;


            bannerAD[0] = "/images/golf/flash_ftm.jpg";
            bannerADlink[0] = ""

            bannerAD[1] = "/images/golf/flash_ftm02.jpg";
            bannerADlink[1] = ""


            bannerAD[2] = "/images/golf/golf01.jpg";
            bannerADlink[2] = ""

            bannerAD[3] = "/images/golf/golf02.jpg";
            bannerADlink[3] = "";

            var preloadedimages = new Array();
            for (i = 1; i < bannerAD.length; i++) {
                preloadedimages[i] = new Image();
                preloadedimages[i].src = bannerAD[i];
            }

            function setTransition() {
                if (document.all) {

                    aspnetForm.bannerADrotator.filters.revealTrans.Transition = Math.floor(Math.random() * 23);
                    aspnetForm.bannerADrotator.filters.revealTrans.apply();
                }
            }

            function playTransition() {
                if (document.all)
                    aspnetForm.bannerADrotator.filters.revealTrans.play()
            }

            function nextAd() {

                if (adNum < bannerAD.length - 1) adNum++;
                else adNum = 0;
                setTransition();
                document.images.bannerADrotator.src = bannerAD[adNum];


                playTransition();
                theTimer = setTimeout("nextAd()", 5000);
            }

            function jump2url() {
                jumpUrl = bannerADlink[adNum];
                jumpTarget = '_blank';
                if (jumpUrl != '') {
                    if (jumpTarget != '') window.open(jumpUrl, jumpTarget);
                    else location.href = jumpUrl;
                }
            }
            function displayStatusMsg() {
                status = bannerADlink[adNum];
                document.returnValue = true;
            }
        </script>


        <script type="text/javascript"> Start()</script>
       
        <div id="health_right">
            <img src="http://images.cnblogs.com/golf/flash_ftm.jpg"
                name="bannerADrotator" id=img1 border="0" align="center" style="filter: revealTrans(duration=2,transition=40)" />
        </div>


    <script language="javascript">
            function Pause(obj, iMinSecond) {
                if (window.eventList == null) window.eventList = new Array();
                var ind = -1;
                for (var i = 0; i < window.eventList.length; i++) {
                    if (window.eventList[i] == null) {
                        window.eventList[i] = obj;
                        ind = i;
                        break;
                    }
                }

                if (ind == -1) {
                    ind = window.eventList.length;
                    window.eventList[ind] = obj;
                }
                setTimeout("GoOn(" + ind + ")", iMinSecond);
            }


            function GoOn(ind) {
                var obj = window.eventList[ind];
                window.eventList[ind] = null;
                if (obj.NextStep) obj.NextStep();
                else obj();
            }

            function Start() {
                Pause(this, 1000); //调用暂停函数
                this.NextStep = function() {
                    nextAd();
                }
            } 
        </script>

  • 相关阅读:
    RESTful API 设计指南【转】
    一款 .NET 下的轻量级 REST 和 HTTP API 客户端
    Windows 服务开发框架介绍
    实例演示 kino.razor (前端 Javascript 模板工具,Razor 风格)的使用
    深入研究 蒋金楠(Artech)老师的 MiniMvc(迷你 MVC),看看 MVC 内部到底是如何运行的
    扩展 IEnumerable<T>,让它根据另一个集合的顺序来排列
    谷歌正式发布Google APIs Client Library for .NET
    身为码农,为12306说两句公道话
    12306外包给阿里巴巴/IBM到底是否可行?
    自定义一个叫 ReadOnlyXmlMembershipProvider 的 MembershipProvider,用 XML 作为用户储藏室
  • 原文地址:https://www.cnblogs.com/zwei1121/p/1568576.html
Copyright © 2011-2022 走看看