講到這個.... 小弟寫 Widget 就都是用 CSS 說....
剪一段範例.....
代碼:
<body onload="setup();">
<div id="FrontWindow">
<div id="topfrostyplaceLogo" onClick="FrostyPlaceLogo.click(event);"></div>
<div id="topbar">
<div id="topbarBackground">
<div id="topbarLeft"></div>
<div id="topbarMiddle"></div>
<div id="topbarRight"></div>
</div>
<div id="topbarExtender">
<div id="topbarExtenderLeft"></div>
<div id="topbarExtenderRight"></div>
</div>
<div id="topbarContent">
<div id="SelectDiv">
<table>
<tr>
<td><span id="frostyplaceSelect0" class="frostyplaceButton"></span></td>
<td><span id="frostyplaceSelect1" class="frostyplaceButton"></span></td>
<td><span id="frostyplaceSelect2" class="frostyplaceButton"></span></td>
</tr>
</table>
</div>
</div>
</div>
有看到一個表格,但是沒有屬性,屬性都在 CSS 裡面,其他都是... DIV
配合 CSS,有近一千行...
這樣 Load 起來會比較快嗎?以現在電腦 + 網路的速度大概感覺不太出來了吧....
不過 CSS 真的很神奇,IE 對 CSS 的支援也一樣多呀,而且也夠用了....
還可以利用 CSS 把 PNG 檔案透明的部份實現喔~ CSS 也藏有很多密技的。
差別在 javascript 能控制的在 IE 跟其他的瀏覽器不一樣囉。