2019年5月28日
摘要: function bubbleSort(arr){ var flag = false; // 定义一个变量为false,未交换位置 for(var i=0;i<arr.length-1;i++){ for(var j=0;j<arr.length-1;j++){ if(arr[j+1]<arr[j] 阅读全文
posted @ 2019-05-28 15:24 千寻岛主 阅读(929) 评论(0) 推荐(0) 编辑
  2019年5月27日
摘要: 1 2 3 4 5 Tab切换 6 7 8 56 57 58 59 60 61 公告 6... 阅读全文
posted @ 2019-05-27 15:57 千寻岛主 阅读(254) 评论(0) 推荐(0) 编辑
摘要: Tab切换 公告 规则 论坛 安全 公益 张勇:快乐足球 ... 阅读全文
posted @ 2019-05-27 15:52 千寻岛主 阅读(165) 评论(0) 推荐(0) 编辑
摘要: function hasClass(obj, cls) { //class位于单词边界,判断class样式是否已经存在 return obj.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')); } //给 obj添加class function addClass(obj, cls) { if (!this.hasClass(obj,... 阅读全文
posted @ 2019-05-27 15:32 千寻岛主 阅读(757) 评论(0) 推荐(0) 编辑
摘要: text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; //字体渐变 background-image: -webkit-linear-gradient(top,#000,#... 阅读全文
posted @ 2019-05-27 15:24 千寻岛主 阅读(243) 评论(0) 推荐(0) 编辑
摘要: if (!document.getElementsByClassName) { document.getElementsByClassName = function(className, element) { var children = (element || document).getElementsByTagName('*'); var elements = new Array(... 阅读全文
posted @ 2019-05-27 10:50 千寻岛主 阅读(136) 评论(0) 推荐(0) 编辑
  2019年5月24日
摘要: 1 function formatDate(date){ 2 if(date == null){ 3 return; 4 } 5 date = new Date(date); 6 var Y=date.getFullYear()+'-', 7 M=(date.getMonth()+1<10?'0'+(date.getMonth(... 阅读全文
posted @ 2019-05-24 11:22 千寻岛主 阅读(414) 评论(0) 推荐(0) 编辑
  2019年5月21日
摘要: JS定时器 传递参数我在使用setTimeout()或setInterval()时, setTimeout(addIcons(),3000); 或 setInterval(addIcons(),3000);总是发现在页面加载的时候,它就直接执行函数,并没有在3秒之后加载。后来去查了一下,才发现问题出 阅读全文
posted @ 2019-05-21 17:03 千寻岛主 阅读(147) 评论(0) 推荐(0) 编辑