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>”); 阅读全文
posted @ 2012-08-30 14:12 时生 阅读(503) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2012-08-24 15:29 时生 阅读(261) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2012-08-23 11:26 时生 阅读(233) 评论(0) 推荐(0)
摘要:var arr = new Array();typeofarr; 不能判断Array,获得的是objectObject.prototype.toString.call(arr); [object Array] 阅读全文
posted @ 2012-08-22 10:09 时生 阅读(211) 评论(0) 推荐(0)
摘要:这样就可以了:xx=xx..replace(/(^\s*)|(\s*$)/g,"");另:去左空格replace(/(^\s*)/g, "");去右空格replace(/(\s*$)/g, "");中文全角空格不可以 阅读全文
posted @ 2012-08-18 17:04 时生 阅读(308) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2012-08-18 09:35 时生 阅读(259) 评论(0) 推荐(0)
摘要:toHexString(int i) 以十六进制的无符号整数形式返回一个整数参数的字符串表示形式。 阅读全文
posted @ 2012-08-15 13:51 时生 阅读(6671) 评论(0) 推荐(0)