jQueryを使い始めたばかりで、少し問題があります。
サムネイルの表を取得しました。セル内の画像にカーソルを合わせると、各セルが強調表示されます。その部分が機能するようになりました。ただし、セル内の画像に下線を付けないようにする必要もあります。これはスタイルシートから継承されますa:hover{text-decoration:underline}
。これは私が立ち往生しているところです、私は私が正しいことを設定しているとは思いません。
インラインスタイルを使用する必要があるため、jQueryは次のようになります。
$('[name*=thumb]').hover(
function () {
//as we hover over an item, change it's background, attempt to vaquish pesky underline
$('#' + $(this).attr('id').replace('thumb', 'thumbcontainer')).css('background-color', '#cccccc');
$('#' + this).css('text-decoration', 'none'); //doesn't work : (
},
function () {
//fix bgs of items we're not hovering on
$('#' + $(this).attr('id').replace('thumb', 'thumbcontainer')).css('background-color', '#ffffff');
}
);
私のHTMLは次のようになります:
<td name="thumbcontainer8" id="thumbcontainer8"><a href="#" name="thumb8" id="thumb8"><img src="..." /></a></td>
<td name="thumbcontainer9" id="thumbcontainer9"><a href="#" name="thumb9" id="thumb9"><img src="..." /></a></td>