随笔分类 - js
摘要:function goTop() {$('html, body').animate({scrollTop:0}, 'slow'); }function goDiv(div) {var a = $("#"+div).offset().top;$("html,body").animate({scroll...
阅读全文
摘要:问题:经常使用jQuery插件的attr方法获取checked属性值,获取的值的大小为未定义,此时可以用prop方法获取其真实值,下面介绍这两种方法的区别: 1.通过prop方法获取checked属性,获取的checked返回值为boolean,选中为true,否则为flase . 代码如下: 全选...
阅读全文
摘要:a=new Date(time); a=a.valueOf(); a = a - 1 * 24 * 60 * 60 * 1000; a=new Date(a); var m=a.getMonth() + 1; var day= a.getDate(); if(m<10) m='0'+m; if(da...
阅读全文
摘要:1、获取单个checkbox选中项(三种写法)$("input:checkbox:checked").val()或者$("input:[type='checkbox']:checked").val();或者$("input:[name='ck']:checked").val();2、 获取多个che...
阅读全文
摘要:Mozilla中:addEventListener的使用方式:target.addEventListener(type, listener, useCapture);target: 文档节点、document、window 或 XMLHttpRequest。type: 字符串,事件名称,不含“on”...
阅读全文
摘要:一、加载js文件1 ZC={AG:function(l,e){if(l.indexOf){return l.indexOf(e)}else{for(var h=0,a=l.length;h2*1024){for(var g in ZC.cache.data){if(ZC.cache.data.has...
阅读全文

浙公网安备 33010602011771号