<img src="../images/sideGameMenu1.png"/ class="winner-nameMoolar" ">
<div class="game-star" style="height: 198px; overflow: hidden;">
<ul>
<li class="Active">
<div class="game-star-icon"></div>
<img src="../images/sideGameMenu1.png"/ class="winner-nameMoolar" ">
<h3 class="winner-name">Major Millions<br>RMB 1000.00</h3>
<!-- <p>RMB 625.78</p> -->
</li>
<li>
<div class="game-star-icon"></div>
<h3 class="winner-name">Major Moolah<br>RMB 3,266.41</h3>
<!-- <p></p> -->
</li>
<li>
<div class="game-star-icon"></div>
<h3 class="winner-name">Major Moolah Isis<br>RMB 4,982.78</h3>
<!-- <p></p> -->
</li>
<li>
<div class="game-star-icon"></div>
<h3 class="winner-name">发大财<br>RMB 8,888.88</h3>
<!-- <p>RMB 396.42</p> -->
</li>
<li>
<div class="game-star-icon"></div>
<h3 class="winner-name">我发我发我发发发<br>RMB 9,999.99</h3>
<!-- <p>RMB 28.89</p> -->
</li>
</ul>
</div>
我希望在li
=“有效”时class
更改图像来源,而“wins-nameMoolar”类仍然存在。
仅更改特定的图像来源,如下所示class
仍然存在。
请建议
<img src="../images/sideGameMenu1.png"/ class="winner-nameMoolar" ">
我的HTML:
<div class="game-star" style="height: 198px; overflow: hidden;">
<ul>
<li class="Active">
<div class="game-star-icon"></div>
<img src="../images/sideGameMenu1.png"/ class="winner-nameMoolar" ">
<h3 class="winner-name">Major Millions<br>RMB 1000.00</h3>
<!-- <p>RMB 625.78</p> -->
</li>
<li>
<div class="game-star-icon"></div>
<h3 class="winner-name">Major Moolah<br>RMB 3,266.41</h3>
<!-- <p></p> -->
</li>
<li>
<div class="game-star-icon"></div>
<h3 class="winner-name">Major Moolah Isis<br>RMB 4,982.78</h3>
<!-- <p></p> -->
</li>
<li>
<div class="game-star-icon"></div>
<h3 class="winner-name">发大财<br>RMB 8,888.88</h3>
<!-- <p>RMB 396.42</p> -->
</li>
<li>
<div class="game-star-icon"></div>
<h3 class="winner-name">我发我发我发发发<br>RMB 9,999.99</h3>
<!-- <p>RMB 28.89</p> -->
</li>
</ul>
</div>
答案 0 :(得分:1)
我希望这段代码可以帮到你..
if ( $('ul > li').hasClass('Active')){
$('ul > li.Active').children('img').attr('src', 'here write path you want');
}
我检查这段代码,对我来说非常适合。