gpt4 book ai didi

twitter-bootstrap - 可折叠 Bootstrap ,显示第一个元素

转载 作者:行者123 更新时间:2023-12-04 03:16:11 27 4
gpt4 key购买 nike

我想展示这个可折叠 Accordion 的第一个元素。我在互联网上做了一些研究,但徒劳无功

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script>

<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne" >
Aller au dossier personnel d'un agent
</a>
</div>
<div id="collapseOne" class="accordion-body collapse" style="height: 0px; ">
<div class="accordion-inner">
<form action="goToAgent.do" method="post">
<p align="center">
<input type="hidden" value="identite" name="retour">
<label for="nomPrenom" >
Entrer le nom complet de l'agent:
</label>
<input type="text" name="nomPrenom" class="typeahead" /> <br>
<input type="submit" value="appliquer" class="btn btn-info" />
</form>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
Ajout d'un nouveau fonctionnaire
</a>
</div>
<div id="collapseTwo" class="accordion-body collapse">
<div class="accordion-inner">
<!-- lorem -->
</div>
</div>
</div>
</div>

最佳答案

我不认为您已经获得了 Accordion 工作所需的所有 HTML,除非您没有将其全部粘贴到上面。

Bootstrap 文档的第一个示例将第一个元素设置为打开:

http://twitter.github.com/bootstrap/javascript.html#collapse (这些文档适用于 v2.3.2,不再受到官方支持。)

我认为是“in”类将其设置为最初打开。

<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
Collapsible Group Item #1
</a>
</div>
<div id="collapseOne" class="accordion-body collapse in">
<div class="accordion-inner">
Anim pariatur cliche...
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
Collapsible Group Item #2
</a>
</div>
<div id="collapseTwo" class="accordion-body collapse">
<div class="accordion-inner">
Anim pariatur cliche...
</div>
</div>
</div>
</div>

关于twitter-bootstrap - 可折叠 Bootstrap ,显示第一个元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14852352/

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