well it has nothing to do with dojo but I don't bother to create another tag, so I keep using it.
when dealing with setting css properties on the fly we may come across some names with hyphens like
z-index, background-color and etc.
unfortunately, when trying to set a new value by domstyle.set(xx, 'z-index', '10');
you may notice it doesn't work.
the correct way is to use camel case like:
domstyle.set(xx, 'zIndex', '10').
本文介绍在动态设置CSS属性时如何避免使用连字符,并正确应用驼峰命名法。通过实例演示,帮助开发者解决在尝试设置属性值时遇到的问题,提高代码可读性和效率。
706

被折叠的 条评论
为什么被折叠?



