• js实现图片自动切换效果。


    js实现图片自动切换效果,简单实用,原谅我只是一只小菜鸟还在学大神天天写博文装逼。

    <script language="javascript">
            setInterval(test, 2000);
            var array = new Array();
            var index = 0;
            var array = new Array("../../Content/images/3s1hj_kqzew4k2ozbhs2dwgfjeg5sckzsew_780x520.jpg", "../../Content/images/3s1hj_kqzewqs2ozbhsrdwgfjeg5sckzsew_450x600.jpg", "../../Content/images/3s1hj_kqzfc4leozbhmtcugfjeg5sckzsew_650x975.jpg");
            function test() {
                var myimg = document.getElementById("imgs");
                if (index == array.length - 1)
                { index = 0; } else { index++; }
                myimg.src = array[index];
            } 
    </script>  


    在页面需要的地方添加这个:
     <img style="200px; height:200px" id="imgs" src="../../Content/images/3s1hj_kqzdoqs2ozbhsq3wgfjeg5sckzsew_450x600.jpg" />
  • 相关阅读:
    大数减法模板
    扩展kmp模板
    poj2185(kmp)
    poj3167(kmp)
    kuangbin专题K(next数组)
    kuangbin专题16I(kmp)
    kuangbin专题16H(next数组)
    kuangbin专题16D(next求最小循环节)
    kuangbin专题16B(kmp模板)
    Java集合--TreeSet
  • 原文地址:https://www.cnblogs.com/sunqiang/p/4495402.html
Copyright © 2020-2023  润新知