【问题标题】:Bootstrap, first data-toggle click doesn't work or data are not displayedBootstrap,第一次数据切换点击不起作用或数据不显示
【发布时间】:2018-05-24 03:47:21
【问题描述】:

我尝试设置 <div id="rowAngleOutputDiv0"> 扩展初始值。 此处描述了相同的问题 Bootstrap data-toggle collapses div after second click, not first 。 我已经按照描述添加了class="collapse in"。但就我而言,该解决方案不起作用。如果我添加 class="collapse in" ,div 元素初始将被隐藏。

  1. 如何设置 <div id="rowAngleOutputDiv0"> 初始展开并避免“引导数据切换第一次单击不起作用”问题?

  2. 如果我离开class="collapse in",那么即使我点击按钮显示所有孩子也会被隐藏。如果设置了class="collapse (in)",如何让这些孩子在点击按钮后可见?

    <button data-toggle="collapse" data-target="#rowAngleOutputDiv0"></button>
    <div id="rowAngleOutputDiv0" class="collapse in">
    
        <div class="row">
            <div id="angleOutputDiv0">
                <canvas id="angleOutput0"></canvas>
            </div>
            <div>
                <div id="dygraphOutC0"></div>
                <div id="dygraphOutC1"></div>
                <div id="dygraphOutC2"></div>
            </div>
        </div>
    </div>
    

【问题讨论】:

  • @Ryankozak 没有重复。正如我在回答中所写的那样,在您发表评论之前,链接中的解决方案在我的情况下不起作用 - 我无法解释原因。但我用“show”替换了“in”,仅此而已。

标签: html css twitter-bootstrap toggle


【解决方案1】:

class="collapse in" 替换为class="collapse show"

那个问题 Bootstrap collapse class doesn't toggle correctly 稍微指导我解决方案

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-10-06
    • 1970-01-01
    • 2017-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多