gpt4 book ai didi

jquery - 更改 div 中的文本

转载 作者:行者123 更新时间:2023-11-28 15:45:57 26 4
gpt4 key购买 nike

我的目标是一旦我点击每张照片 - 现在不显示(但你可以看到损坏的图像图标)这个 div 中的文本“core-tab-sec”应改变。您现在看到三个段落,每个段落都对应一张照片。所以应该隐藏其中两个,只显示一个。

谁能帮我解决这个问题?所以这是我所有的代码 https://jsfiddle.net/net1994/7zovyuow/

<div class="core-tab-sec">
<ul class="core-tabNav">
<li class="active"><a href="#tab1"><figure><img src="<?php bloginfo('template_url'); ?>/img/people-icon.png" alt="PEOPLE"></figure><div>PEOPLE</div></a></li>
<li><a href="#tab2"><figure><img src="<?php bloginfo('template_url'); ?>/img/passion-icon.png" alt="PASSION"></figure><div>PASSION</div></a></li>
<li><a href="#tab3"><figure><img src="<?php bloginfo('template_url'); ?>/img/performance.png" alt="PERFORMANCE"></figure><div>PERFORMANCE</div></a></li>
</ul>

<div class="core-tabCnt">
<div class="core-tabSec" id="tab-1">
<p>We believe in people. People solve problems. Our employees are passionate problem solvers always looking for long-term solutions that will benefit our clients and OneIMS. They thrive in and promote a collaborative and innovative environment, working hard to achieve corporate goals.</p>
</div>
<div class="core-tabSec" id="tab2">
<p>We could not be a marketing company without being passionate about innovation. From keeping up with industry changes to using the latest techniques, our creativity and passion drives innovation that helps our clients achieve their goals.</p>
</div>
<div class="core-tabSec" id="tab3">
<p>The success of our clients is driven by results. Results are driven by our performance. That’s why we relentlessly pursue success, strive for flawless execution, work hard and continuously look for ways to maximize our client’s return on investment. </p>
</div>
</div>

</div>

如何做到这一点?我可以用 css 或 js 做吗?谢谢!!

最佳答案

例如你想显示 id = tab2 剩下的是隐藏只需使用{$('.core-tabSec').hide();
$('#tab2').show();

关于jquery - 更改 div 中的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35169090/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com