我需要切换内容的帮助 - 在几列中,我做了隐藏的内容,它显示在按钮点击。 (在窗格生物文本点击BTN-切换显示内容)切换只显示点击的内容 - 隐藏其他
<div class="wpb_wrapper">
<div class="bio"><a class="btn-show">Arnold Schwarzenegger,Chairman, CEO & Partner</a></div>
<p class="bio-text" style="display: none;">Arnold Alois Schwarzenegger (born July 30, 1947) is an Austrian-American actor, model, producer, director, activist, businessman, investor, writer, philanthropist, former professional bodybuilder, and politician. Schwarzenegger served two terms as the 38th Governor of California from 2003 until 2011.</p>
</div>
现在我有4个包装这样的。 它通过jQuery实现。问题是,目前情况如何,它支持所有的切换活动。我需要重新格式化我的代码,只允许1被激活(在其他隐藏单击除点击一个所有扩展的内容) 下面是一个代码:
jQuery(document).ready(function ($) {
$('.bio-text').hide();
$('.btn-show').click(function() {
// $this determines which button clicked on
var $this = $(this);
// grab the text that is NEXT to the button that was clicked on
//var theText = $this.next();
var theText = $this.parent().next(".bio-text");
// Change the text of the button depending on if the text is hidden
theText.slideToggle(500);
$this.parent().toggleClass('highlight');
});
});
所以这是工作,但允许所有窗格中打开在同一时间。 我需要帮助才能使这个排他性的内容窗格显示出来。
在此先感谢
请添加满标记,以便我们提供帮助。 – Ionut
你想让手风琴作出来吗 –