好的,我有一個包含jQuery的HTML頁面。如何從jQuery中讀取CSS文件
我有在行良好的負荷CSS文件,我想讀所有樣式從外部CSS文件中給定的元素......不是內嵌樣式...
我有下面的代碼(這看起來像它應該工作...):
var styleProperties= {};
var getCssProperties = ['width', 'margin', 'height'];
for (c=0;c<=returnStyleProps.length;c++) {
styleProperties[returnStyleProps[c]] = $('div#container').css(returnStyleProps[c]);
alert(styleProperties);
}
alert(styleProperties);
但這似乎只提醒:
"[Object Object]"
[編輯]請...?我真的很堅持,似乎沒有任何工作:([/編輯]
什麼是'returnStyleProps'? – Reigel 2010-06-03 08:59:20
哎呀,編輯:) – 2010-06-03 09:02:00
什麼是'我'?在'for(c = 0; i <= returnStyleProps.length; C++){...}' – Reigel 2010-06-03 09:07:16