Date.prototype.format = function (partten) { if (partten == null || partten == ) { partten = y-m-d; } var y = this.getFullYear(); var m = this.getMonth() + 1; var d = this.getDate(); var r = partten.replace(/y+/gi, y); r = r.replace(/m+/gi,...
//两种方法设置disabled属性 $(# xxx ).attr(disabled,true); $(# xxx ).attr(disabled,disabled); //三种方法移除disabled属性 $(#xxx).attr(disabled,false); $(# xxx ).removeAttr(disabled);...
$(#xxx).attr(disabled,disabled);...
//开启 var time ; time= setTimeout(function(){xxx}, 1000); //关闭 clearTimeout(time);...
事件与事件对象 首先,我们来看一下经常使用的添加事件的方式: input type =button id =btn value =click me! onclick =showMsg(); / script type =text/javascript function showMsg() { alert( msg is showing! ); } / script 我们...
script type=text/javascriptvar u = navigator.userAgent, app = navigator.appVersion;var isAndroid = u.indexOf(Android) -1 || u.indexOf(Linux) -1; //android终端或者uc浏览器var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端...
IE中: document.body.clientWidth == BODY对象宽度 document.body.clientHeight == BODY对象高度 document.documentElement.clientWidth == 可见区域宽度 document.documentElement.clientHeight == 可见区域高度 FireFox中: docum...
script language=javascript //获取当前域名 host = window.location.host; //获取当前页面完整链接 url = window.location.href; /script...
一种情况是写在onclick,下面两种写法都可以: input type =submit value =提交1 onClick =return checkform() //IE可以阻止,FF可以阻止 input type =submit value =提交4 onClick =checkform_success(event) //IE可以阻止...
主要功能代码如下: 01 script type= text/javascript 02 var flag = true ; 03 $( function (){ 04 var $container = $( #listing ); 05 $container.masonry({ 06 singleMode: true , 07 animate: true , 08 itemSelector: .post 09 }); 10 //滚动条...