我将 href 链接分配给 12 个锚标记中的 12 个,只有前 6 个被分配,其他 6 个没有被分配。锚标签位于猫头鹰轮播中。以下是代码
$("#australia").on("click",function(e) {
$("#link1").attr("href", "aust");
$("#link2").attr("href", "aust");
$("#link3").attr("href", "aust");
$("#link4").attr("href", "aust");
$("#link5").attr("href", "aust");
$("#link6").attr("href", "aust");
$("#link7").attr("href", "aust");
$("#link8").attr("href", "aust");
$("#link9").attr("href", "aust");
$("#link10").attr("href", "aust");
$("#link11").attr("href", "aust");
$("#link12").attr("href", "aust");
});
HTML 代码:-
<div class="pricing-area section-padding">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="section-tittle text-center">
<h2>Choose your Plan</h2>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 flags">
<p>Select server location to host your VPS</p>
<div id="australia" class="flag active"><img src="img/flags/australia.png" alt="australia"><span>Australia</span></div>
<div id="canada" class="flag"><img src="img/flags/canada.png" alt="canada"><span>Canada</span></div>
<div id="france" class="flag"><img src="img/flags/france.png" alt="france"><span>France</span></div>
<div id="germany" class="flag"><img src="img/flags/germany.png" alt="germany"><span>Germany</span></div>
<div id="poland" class="flag"><img src="img/flags/poland.png" alt="poland"><span>Poland</span></div>
<div id="singapore" class="flag"><img src="img/flags/singapore.png" alt="singapore"><span>Singapore</span></div>
<div id="uk" class="flag"><img src="img/flags/uk.png" alt="uk"><span>UK</span></div>
我认为这是一个 DOM 问题.......如何解决?提前致谢。
呼如林
相关分类