摘要:
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] 阅读全文
摘要:
1 2 3 4 5 Tab切换 6 7 8 56 57 58 59 60 61 公告 6... 阅读全文
摘要:
Tab切换 公告 规则 论坛 安全 公益 张勇:快乐足球 ... 阅读全文
摘要:
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,... 阅读全文
摘要:
text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; //字体渐变 background-image: -webkit-linear-gradient(top,#000,#... 阅读全文
摘要:
if (!document.getElementsByClassName) { document.getElementsByClassName = function(className, element) { var children = (element || document).getElementsByTagName('*'); var elements = new Array(... 阅读全文
摘要:
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(... 阅读全文
摘要:
JS定时器 传递参数我在使用setTimeout()或setInterval()时, setTimeout(addIcons(),3000); 或 setInterval(addIcons(),3000);总是发现在页面加载的时候,它就直接执行函数,并没有在3秒之后加载。后来去查了一下,才发现问题出 阅读全文