我有以下内容:
JS:
$('.home-toggle').click(function() {
scroll();
$('#content twelvecol > a').removeClass('selected-tile');
$(this).addClass('selected-tile');
$('.hidden').hide();
$('.home-container').slideDown();
});
$('.why-toggle').click(function() {
scroll();
$('#content twelvecol > a').removeClass('selected-tile');
$(this).addClass('selected-tile');
$('.hidden').hide();
$('.why-container').slideDown();
});
HTML:
<div id="content" class="container" style="display:none;">
<div class="row">
<div class="twelvecol">
<a href="#" class="home-toggle tile first">
<img class="tile-top" src="images/tile1.png" alt="" />
<img class="tile-bottom" src="images/tile1h.png" alt="" />
</a>
<a href="#" class="why-toggle tile">
<img class="tile-top" src="images/tile2.png" alt="" />
<img class="tile-bottom" src="images/tile2h.png" alt="" />
</a>
<a href="#" class="solutions-toggle tile last">
<img class="tile-top" src="images/tile3.png" alt="" />
<img class="tile-bottom" src="images/tile3h.png" alt="" />
</a>
因此,一旦我单击一个,就.selected-tile
应该从另一个中删除。.tile
但由于某种原因,该类仍保留在其他图块中。
可能是什么问题呢?