08 2012 档案
摘要:$(”p”).addClass(css中定义的样式类型); 给某个元素添加样式$(”img”).attr({src:”test.jpg”,alt:”test Image”}); 给某个元素添加属性/值,参数是map$(”img”).attr(”src”,”test.jpg”); 给某个元素添加属性/值$(”img”).attr(”title”, function() { return this.src }); 给某个元素添加属性/值$(”元素名称”).html(); 获得该元素内的内容(元素,文本等)$(”元素名称”).html(”<b>new stuff</b>”);
阅读全文
摘要:var A=function(){this.m=10;return 20;}var aa=new A();alert(aa.m);var A=function(){this.m="this is it";var that={};that.name="that is that";return that;}var o=new A();alert(o.m);答案就很明显了~第一个是10 因为未返回对象,所以默认返回function对象(this指向Function)第二个是未定义,因为返回的是对象,对象里木有m转自:http://99jty.com/?p=54
阅读全文
摘要:http://www.cnblogs.com/guopei/archive/2011/04/17/2019045.htmlhttp://www.cnblogs.com/PrimerDotNet/archive/2011/04/14/2015548.htmlhttp://rt0d.iteye.com/blog/1003613
阅读全文
摘要:var arr = new Array();typeofarr; 不能判断Array,获得的是objectObject.prototype.toString.call(arr); [object Array]
阅读全文
摘要:这样就可以了:xx=xx..replace(/(^\s*)|(\s*$)/g,"");另:去左空格replace(/(^\s*)/g, "");去右空格replace(/(\s*$)/g, "");中文全角空格不可以
阅读全文
摘要:showDiv($("#pop"));function showDiv(obj){ $(obj).show(); center(obj); $(window).scroll(function(){ center(obj); }); $(window).resize(function(){ center(obj); });}function center(obj){ var windowWidth = document.documentElement.clientWidth; var windowHeight = document.documentElement.client
阅读全文
摘要:toHexString(int i) 以十六进制的无符号整数形式返回一个整数参数的字符串表示形式。
阅读全文

浙公网安备 33010602011771号