2011年2月28日 星期一

Switching DIV Background Image With jQuery

範例如下:
$('#divID').css("background-image", "url(/myimage.jpg)"); 

$('#divID').click(function()
{
  // do my image switching logic here.
});

$('#divID').mouseover(function()
{
  // do my image switching logic here.
});

$('#divID').mouseout(function()
{
  // do my image switching logic here.
});
 

2011年2月25日 星期五

表格的colspan在firefox顯示不出來怎麼辦?

參考資料:http://thedesignspace.net/MT2archives/000376.html

<table border=1>
<tr style="display:block">
<th colspan="3">
Using display:block on this table. This th should span 3 columns
</th>
</tr>
<tr> 
<td>cell 1</td>
<td>cell 2</td>
<td>cell 3</td>
</tr>
</table>
<table border=1>
<tr style="display:table-row">
<th colspan="3">
Using display:table-row on this table. This th should span 3 columns
</th>
</tr>
<tr> 
<td>cell 1</td>
<td>cell 2 </td>
<td>cell 3</td>
</tr>
</table>
把display:block改用display:table-row,就ok啦!