zoukankan      html  css  js  c++  java
  • js循环遍历弹框,先弹出第一个之后逐步弹出第二个。。

    var data = [{
      "login_advertTitle": "即使生活琐碎,也要活得优雅",
      "login_advertCont": "<html>
    <head>
    	<title></title>
    </head>
    <body>
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">Who can say that their lives are not insignificant?</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  谁的生活不琐碎呢?</p>
    
    <center style="padding: 0px; margin: 0px; color: rgb(51, 51, 51); font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);"><img alt="唯美图片" height="371" src="https://www.yueduwen.com/uploads/allimg/1802/1-1P20320593L18.jpg" style="padding: 0px; margin: 0px 0px 10px; border: none; box-shadow: rgb(174, 174, 174) 2px 3px 3px;" width="600" /></center>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  Everyone's life is composed with one after another insignificant day.</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  我们的一生,都是由这一个个琐碎的一天构成的。</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  Some people got their willpower abraded in this endless loop of days.</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  有的人在这日复一日的循环中被消磨了意志。</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  They think this is how things can only be like.<span class="yueduwencom" style="padding: 0px; margin: -30px 0px 0px; position: relative; top: -5000px; left: -10000px; display: block;">(<a href="http://www.yueduwen.com/" style="padding: 0px; margin: 0px; color: rgb(0, 112, 192);">悦读文网</a> www.yueduwen.com)</span></p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  认为一切也就这样了。</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  So they choose to reach a compromise and become mediocre. They become the background colors in others' eyes. They won't achieve anything great to be written down in history, nor can they bring any enjoyment to the people around them.</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  于是他们选择与平庸妥协,成为别人眼中的背景颜色,不光不会在历史上留下一笔伟绩,甚至无法为身边的人平添一抹色彩。</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  They are alive, but deep down in their hearts something important has died.</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  他们活着,但他们心中的一部分已经死了。</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  And there are another kind of people. They choose to live with dignity.</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  而另一些人,他们依旧选择有尊严地活着。</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  A graceful lifestyle is not a show for others to watch. You live it because you deserve it. Through it, you are avoiding to become a victim of this cruel world.</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  优雅的生活方式并不是为别人做的表演,而是为了对得起自己,让自己不会成为无情社会摧残下的牺牲品。</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  This kind of people know how to find joy in simple things. They know how to make a common day safisticated and meaningful.</p>
    
    <center style="padding: 0px; margin: 0px; color: rgb(51, 51, 51); font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);"><img alt="唯美图片" height="371" src="https://www.yueduwen.com/uploads/allimg/1802/1-1P2032100022V.jpg" style="padding: 0px; margin: 0px 0px 10px; border: none; box-shadow: rgb(174, 174, 174) 2px 3px 3px;" width="600" /></center>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  他们懂得如何去发掘单纯事物中的喜悦,懂得如何将平凡的时光过得精致而充实。</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  Life has denied them some beauty. But they build them with their own hands.</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  那份生活中缺失的美丽,他们靠自己的双手创造了出来。</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  So which kind of these two are you? And which kind are you willing to be?</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  你的人生是哪种?你想过哪一种?</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  Have you find the answer?</p>
    
    <p style="padding: 10px 0px; margin: 0px; color: rgb(67, 67, 67); font-size: 16px; line-height: 2; text-indent: 2em; font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; background-color: rgb(255, 255, 255);">  你找到答案了吗?</p>
    </body>
    </html>
    ",
      "login_advertTime": "15000",
      "login_adverClose": "1"
    }, {
      "login_advertTitle": "aaaaaaa",
      "login_advertCont": "<html>
    <head>
    	<title></title>
    </head>
    <body>asdasdasassdas d<br />
    <img alt="" src="/jeecg/upload//1534303323463.jpg" style=" 250px; height: 275px;" /><br />
    99999999999999</body>
    </html>
    ",
      "login_advertTime": "15000",
      "login_adverClose": "1"
    }];
    
    var i = 0;
    
    // 添加计时器
    var time = setInterval(function () {
      if (i >= data.length) {
        clearInterval(time);
      } else {
        OpenAdvert(data[i].login_advertTitle, data[i].login_advertCont, data[i].login_advertTime, data[i].login_adverClose);
        i++;
      }
    }, 5000);
    //弹出广告信息
    function OpenAdvert(title, con, time, close) {
      layer.open({
        type: 1,
        title: title,
        fix: false,
        shadeClose: true,
        offset: 'rb',
        anim: 2,
        maxmin: true,
        area: ['1000px', '500px'],
        content: con,
        shade: 0,
        shadeClose: true,
        time: time,
        cancel: function (index, layero) {
          // 判断是否强制关闭
          if (close == 1) {
            return true;
          } else if (close == 0) {
            return false;
          }
        }
      });
    }  
  • 相关阅读:
    【BZOJ2666】[cqoi2012]组装 贪心
    【BZOJ1018】[SHOI2008]堵塞的交通traffic 线段树
    【BZOJ3997】[TJOI2015]组合数学 最长反链
    【BZOJ4052】[Cerc2013]Magical GCD 乱搞
    【BZOJ4059】[Cerc2012]Non-boring sequences 分治
    【BZOJ2529】[Poi2011]Sticks 贪心
    【BZOJ4264】小C找朋友 随机化
    【BZOJ4966】总统选举 线段树+随机化
    【BZOJ3796】Mushroom追妹纸 二分+hash
    【BZOJ1146】[CTSC2008]网络管理Network 树状数组+DFS序+主席树
  • 原文地址:https://www.cnblogs.com/Web-Architecture/p/9482079.html
Copyright © 2011-2022 走看看