js循环遍历弹框,先弹出第一个之后逐步弹出第二个。。

var data = [{
  "login_advertTitle": "即使生活琐碎,也要活得优雅",
  "login_advertCont": "<html>\r\n<head>\r\n\t<title></title>\r\n</head>\r\n<body>\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n\r\n<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>\r\n</body>\r\n</html>\r\n",
  "login_advertTime": "15000",
  "login_adverClose": "1"
}, {
  "login_advertTitle": "aaaaaaa",
  "login_advertCont": "<html>\r\n<head>\r\n\t<title></title>\r\n</head>\r\n<body>asdasdasassdas d<br />\r\n<img alt=\"\" src=\"/jeecg/upload//1534303323463.jpg\" style=\"width: 250px; height: 275px;\" /><br />\r\n99999999999999</body>\r\n</html>\r\n",
  "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;
      }
    }
  });
}  

原文地址:https://www.cnblogs.com/Web-Architecture/p/9482079.html

时间: 2024-10-03 14:24:04

js循环遍历弹框,先弹出第一个之后逐步弹出第二个。。的相关文章

JS 循环遍历JSON数据 分类: JS技术 JS JQuery 2010-12-01 13:56 43646人阅读 评论(5) 收藏 举报 jsonc JSON数据如:{&amp;quot;options&amp;quot;:&amp;quot;[{

JS 循环遍历JSON数据 分类: JS技术 JS JQuery2010-12-01 13:56 43646人阅读 评论(5) 收藏 举报 jsonc JSON数据如:{"options":"[{/"text/":/"王家湾/",/"value/":/"9/"},{/"text/":/"李家湾/",/"valu e/":/"10

JS 循环遍历JSON数据

JSON数据如:{"options":"[{/"text/":/"王家湾/",/"value/":/"9/"},{/"text/":/"李家湾/",/"value/":/"10/"},{/"text/":/"邵家湾/",/"value/":/"13/

IOS UIAlertController 弹框 (ios 9.0 后代替了UIAlertView弹框 和 UIActionSheet下弹框)

在IOS 9.0 后 苹果官方宣布不再或不推荐使用UIAlertView 和 UIActionSheet 由UIAlertController进行代替两者 用控制器将两者合二为一 很简单 方便 下面就是关于UIAlertView的常用方法 #import "RootViewController.h" @interface RootViewController () @end @implementation RootViewController - (void)viewDidLoad {

JS 循环遍历 总结

一.循环遍历语句 for...in... (ES5) 语法:javascript for(keys in obj){} 适用:遍历对象 说明: 1.keys表示obj对象的每一个键值对的键(键名),所有循环中,需要使用obj[keys]来取到每一个值. 2.for-in 循环,遍历时不仅能读取对象自身上面的成员属性,也能延续原型链遍历出对象的原型属性 3.使用hasOwnProperty判断一个属性是不是对象自身上的属性.obj.hasOwnProperty(keys)==true 表示这个属性

js 循环遍历

1  map 返回一个新的数组,每个元素为调用func的结果, 不改变原数组 let list = [1, 2, 3, 4, 5]; let other = list.map((d, index) => { return d * 2; }); 2  filter 返回一个新的数组,每个元素为调用func的结果, 不改变原数组 let list = [1, 2, 3, 4, 5]; let other = list.filter((d, i) => { return d % 2; }); 3  

js循环遍历条件归类优化

[{"uuid":"3fadb39c-e19b-44af-846e-29ef6766433d","url":"http://xx.com/detail/ajax.do","time":"1409","ua":"Mozilla/5.0 (Linux; U; Android 4.4.2; zh-CN; Coolpad 8297 Build/KOT49H) App

JS 循环遍历json

第一  看看json的格式 { "employees": [ { "firstName":"Bill" , "lastName":"Gates" }, { "firstName":"George" , "lastName":"Bush" }, { "firstName":"Thomas"

弹框CSS、JS

非本人原创,此为本人导师代码,在此整理分析. 1.遮蔽层,弹框弹出时,页面变灰. CSS部分 .overlay{display:none;position:fixed;left:0;top:0;z-index:1000;width:100%;height:100%;background-color:hsla(0, 0%, 0%, .7);} 2.定时提示小弹框,页面垂直居中显示 CSS部分 /*toast提示*/ .toast{position:fixed;top:50%;left:50%;z-

css-dialog样式实现弹框蒙层全屏无需JS计算高度兼容IE7

<!DOCTYPE html><html><head>  <meta charset="UTF-8">  <title>css-dialog</title>  <script src="http://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script> </head><style type="