Javascript 對於 !important 的處理

一直跑的很好,但是我們家的 在使用者自訂 CSS 時對 height/width 標 !important 就會爛掉…

今天花了時間去找,終於找到解法了:用 style.setProperty 蓋過去。在 這邊的程式碼裡面這樣寫:

this.style.setProperty('height', 'auto', 'important');
this.style.setProperty('width', 'auto', 'important');

改好的版本已經放到 上了:,效果可以參考 這本相本。

This entry was posted in Computer, Murmuring, Network, Programming, Recreation, Software, WWW. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>