- 博客(2)
- 收藏
- 关注
原创 DOM元素尺寸和位置
一,获取元素CSS大小 1.通过style内联获取元素大小: box.style.width box.style.height ps:有则获取,没有返回空 2.通过计算获取元素大小 var style = window.getComputedStyle ? window.getComputedStyle(box,null):null||box.currentStyle; style.
2013-03-19 19:52:06
556
原创 setAttribute()的兼容性
javascript中setAttribute作为改变和增加样式的值时存在兼容性问题。 在firefox中可以很好地支持这个属性,在IE中则存在bug。IE中,setAttribute("class",value)不识别,应该写成setAttribute("className",value); input的text,当将html赋值为某个div的innerHTML时,遇到一个现象
2013-03-16 14:58:53
513
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人