阅读背景:

jQuery和动态元素vs显示css属性

来源:互联网 

While designing html interface elements it's a pretty common scenario having DOMs show/hide depending on certain events. My question is simple, but every time I run into this I always wonder: is it "better" to have the elements hardcoded in the html and simply switch the display attribute (eg with .show/.hide) or dynamically add/remove them as needed via JS? Both are trivial to implement but I can't help but wonder how do they compare and whether there's any advantage/drawback of using one over the other.While designing html interface elements it's a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: