Href到div上同样不起作用

时间:2016-02-12 15:10:29

标签: javascript jquery html css

我的问题是我有一个<a href="#"> </a>标记,我无法转到div并添加inactive课程,然后当我选择另一个<a href="#"> </a>时,我可以&# 39;从首先选择的div中删除inactive类,然后我就不能在href div中包含的单击id上设置它。是否有js或jquery可以处理这个?

这是我的代码(href标签):

<div id="MainMenu">
    <div class="list-group panel">
        <a href="#demo1" class="list-group-item list-group-item-info" data-toggle="collapse" data-parent="#MainMenu">Orari Bus Italia </a>
        <div class="collapse" id="demo1">
            <a href="#dropdown1" class="list-group-item">A2 CHIAVENNA - COLICO</a>
            <a href="#dropdown2" class="list-group-item">A3 CHIAVENNA - GORDONA - SAMOLACO</a>
            <a href="#dropdown7" class="list-group-item">A4 CHIAVENNA - CAMPODOLCINO - MADESIMO</a>
            <a href="#dropdown9" class="list-group-item">A6 CHIAVENNA - OLMO</a>
        </div>
        <a href="#demo2" class="list-group-item list-group-item-info" data-toggle="collapse" data-parent="#MainMenu">Orari Bus St. Moriz </a>
        <div class="collapse" id="demo2">
            <a href="#dropdown3" class="list-group-item">Orari Autopostale Svizzero da Chiavenna a St.Moritz</a>
            <a href="#dropdown4" class="list-group-item">Orari Autopostale Svizzero da Chiavenna a Lugano</a>
        </div>
        <a href="#demo3" class="list-group-item list-group-item-info" data-toggle="collapse" data-parent="#MainMenu">Orari Treni </a>
        <div class="collapse" id="demo3">
            <a href="#dropdown5" class="list-group-item">Orari Treni - Chiavenna - Milano</a>
            <a href="#dropdown6" class="list-group-item">Orari Treni - Chiavenna - Sondrio</a>
        </div>
        <a href="#demo4" class="list-group-item list-group-item-info" data-toggle="collapse" data-parent="#MainMenu">Informazioni Turistiche</a>
        <div class="collapse" id="demo4">
            <a href="#sectionB" class="list-group-item">Informazioni turistiche</a>
        </div>
    </div>
</div>

然后,这里有我上面链接的div标签:

<div class="tab-content">
    <div id="dropdown1" class="tab-pane fade">
        <h3>Orari Bus Italia - A2 CHIAVENNA - COLICO</h3>
        <div id="wrapper" style="position: relative;">
        <div id="block" style="position: absolute; top: 0; left: 0; width: 100%; height: 100px"></div>
        <iframe src="http://www.stps.it/tratte/Details.aspx?id=219"></iframe>
    </div>
</div>
<div id="dropdown2" class="tab-pane fade">
    <h3>Orari Bus Italia - A3 CHIAVENNA - GORDONA - SAMOLACO</h3>
    <div id="wrapper" style="position: relative;">
        <div id="block" style="position: absolute; top: 0; left: 0; width: 100%; height: 100px"></div>
        <iframe src="http://www.stps.it/tratte/Details.aspx?id=216"></iframe>
        </div>
    </div>
    <div id="dropdown7" class="tab-pane fade">
        <h3>Orari Bus Italia - A4 CHIAVENNA - CAMPODOLCINO - MADESIMO</h3>
        <div id="wrapper" style="position: relative;">
            <div id="block" style="position: absolute; top: 0; left: 0; width: 100%; height: 100px"></div>
            <iframe src="http://www.stps.it/tratte/Details.aspx?id=215"></iframe>
        </div>
    </div>
    <div id="dropdown8" class="tab-pane fade">
            <h3>Orari Bus Italia - A5 CHIAVENNA - VILLA DI CHIAVENNA</h3>
            <div id="wrapper" style="position: relative;">
                <div id="block" style="position: absolute; top: 0; left: 0; width: 100%; height: 100px"></div>
                <iframe src="http://www.stps.it/tratte/Details.aspx?id=218"></iframe>
            </div>
        </div>
        <div id="dropdown9" class="tab-pane fade">
            <h3>Orari Bus Italia - A6 CHIAVENNA - OLMO</h3>
            <div id="wrapper" style="position: relative;">
                <div id="block" style="position: absolute; top: 0; left: 0; width: 100%; height: 100px"></div>
                <iframe src="http://www.stps.it/tratte/Details.aspx?id=214"></iframe>
            </div>
        </div>
        <div id="dropdown3" class="tab-pane fade">
            <h3>Chiavenna-St.Moritz</h3>
            <iframe src="https://goo.gl/2jgijH"></iframe>
        </div>
        <div id="dropdown4" class="tab-pane fade">
            <h3>Chiavenna-Lugano</h3>
            <iframe src="https://goo.gl/EjMZs2"></iframe>
        </div>
        <div id="dropdown5" class="tab-pane fade">
            <h3>Chiavenna - Colico - Milano</h3>
            <div id="wrapper" style="position: relative;">
                <div id="block" style="position: absolute; top: 0; left: 0; width: 100%; height: 1080px"></div>
                <iframe id="orariMilano"></iframe>
            </div>
        </div>
        <div id="dropdown6" class="tab-pane fade">
            <h3>Chiavenna - Colico - Sondrio</h3>
            <div id="wrapper" style="position: relative;">
                <div id="block" style="position: absolute; top: 0; left: 0; width: 100%; height: 1080px"></div>
                <iframe id="orariSondrio"></iframe>
            </div>
        </div>
        <div id="sectionB" class="tab-pane fade">
            <h3>Informazioni turistiche</h3>
            <wr:Grid/>
        </div>
        <div id="sectionA" class="tab-pane fade in active">
            <h3>Informazioni su come utilizzare il Totem</h3>
            <p>Per utilizzare il Totem...</p>
        </div>
    </div>
</div>

0 个答案:

没有答案