摘要: 使用js操作css属性的写法:和css中的写法不同:1、对于没有中划线的css属性一般直接使用style.属性名即可。如:obj.style.margin,obj.style.width,obj.style.left,obj.style.position等。2、对于含有中划线的css属性,将每个中划线去掉并将每个中划线后的第一个字符换成大写即可。如:obj.style.marginTop,obj.style.borderLeftWidth,obj.style.zIndex,obj.style.fontFamily等。这个规律我想大多数的前端开发者也都熟知。对在css中有一个特殊的属性其js使用 阅读全文
posted @ 2013-02-04 15:58 hlp鹏 阅读(241) 评论(0) 推荐(0) 编辑
摘要: window.opener 实际上就是通过window.open打开的窗体的父窗体。比如在父窗体parentForm里面 通过 window.open("subForm.html"),那么在subform.html中 window.opener就代表parentForm,可以通过这种方式设置父窗体的值或者调用js方法。如:1,window.opener.test(); ---调用父窗体中的test()方法 2,如果window.opener存在,设置parentForm中stockBox的值。 if (window.opener && !window.ope 阅读全文
posted @ 2013-02-04 15:25 hlp鹏 阅读(222) 评论(0) 推荐(0) 编辑