我在页面顶部有一个自举旋转木马,底部有一个折叠手风琴,独立工作,两个项目的数量相同。
我希望能够点击幻灯片指示器(或幻灯片上的任何位置,即标题,按钮)并让目标手风琴面板显示内容。
以下是我的代码片段:
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-sevenhabits" data-slide-to="0" class="active"></li>
<li data-target="#carousel-sevenhabits" data-slide-to="1"></li>
<li data-target="#carousel-sevenhabits" data-slide-to="2"></li>
<li data-target="#carousel-sevenhabits" data-slide-to="3"></li>
<li data-target="#carousel-sevenhabits" data-slide-to="4"></li>
<li data-target="#carousel-sevenhabits" data-slide-to="5"></li>
<li data-target="#carousel-sevenhabits" data-slide-to="6"></li>
</ol>
...
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<span class="glyphicon glyphicon-play" aria-hidden="true"></span> Habit #1: Be Proactive
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
Be Proactive is about taking responsibility for your life. You can't keep blaming everything on your parents or grandparents. Proactive people recognize that they are "response-able." They don't blame genetics, circumstances, conditions, or conditioning for their behavior. They know they choose their behavior.<br><br>
Reactive people, on the other hand, are often affected by their physical environment. They find external sources to blame for their behavior. If the weather is good, they feel good. If it isn't, it affects their attitude and performance, and they blame the weather. All of these external forces act as stimuli that we respond to.<br><br>
Between the stimulus and the response is your greatest power—you have the freedom to choose your response. One of the most important things you choose is what you say. Your language is a good indicator of how you see yourself.<br><br>
A proactive person uses proactive language—I can, I will, I prefer, etc. A reactive person uses reactive language—I can't, I have to, if only. Reactive people believe they are not responsible for what they say and do—they have no choice.
</div>
</div>