Bootstrap Accordian Column不收缩或扩展

时间:2016-06-02 14:18:58

标签: jquery css twitter-bootstrap-3 accordion

我已经在这里搜索了答案,但我无法找到任何可以回答我关于为什么自举手风琴没有扩展的问题。对于其他用户来说,这是他们的标题中的JavaScript src链接的排序,我已经检查过,但这对我来说不是问题。当我点击手风琴标题时,它不会收缩,而是跳转到文本正文(文本总是展开)。 我希望手风琴扩展包含在布局左侧的一列中,并且手风琴可以在一次点击时展开和缩回。我想知道我的JQuery是否引起了冲突(我使用高度匹配来使右边的灰色列与左边的列匹配。)一旦我在左边的列上创建了一个高度匹配就停止了工作手风琴,但我已经尝试删除标题中的链接,它似乎没有什么区别 这是看起来像: the layout of the site 这是我的布局代码:



$(document).ready(function() {
  var height = $('#collapseOne').outerHeight();
  $('#profilePanel').css('height', height + 'px');
});

html,
body {
  padding: 0;
  margin: 0;
  height: 100%;
}
#collapseOne {
  background-color: #d5d5d5;
}
.row {
  height: 100%;
}
.h1 {
  font-family: 'Montserrat', sans-serif;
}
.h3 {
  font-family: 'Montserrat', sans-serif;
}
.page-header {
  margin: 0;
  padding: 0;
}
.headerone {
  color: #ffffff;
  font-family: 'Oxygen', sans-serif;
  font-size: 3.5em;
  background-color: #000;
  font-weight: bold;
}
.panel-footer {
  color: #fff;
  background-color: #0f0f0f;
}
.container-fluid {
  padding: 0;
}
.main {
  height: 100%;
}
.row {
  height: 100%;
}
.row #gameInfo {
  padding: 0.8em;
  padding-top: 0.1em;
  background-color: #d5d5d5;
}
.row #mainContent {
  background-color: #fff;
}
.row #profilePanel {
  padding: 0.8em;
  background-color: #d5d5d5;
  height: 100%;
}
#profilePanel img {
  position: relative;
}

<!DOCTYPE HTML>
<html>

<head>
  <link rel="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous" />
  <link rel='shortcut icon' href='../image/favicon2.png' type='image/png' />
  <title>GameSetMatch</title>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  <link rel="stylesheet" href="css/style.css" />
  <link rel="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous" />
  <meta name="viewport" content="width = device-width, initial-scale = 1">
  <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
  <script src="getheight.js"></script>

</head>

<body>

  <div class="container-fluid">
    <div class="page-header">
      <div class="headerone">
        <img src="../image/gamesetmatchlogo2.png" alt="logo" width="150" />GameSetMatch</div>
    </div>
    <main>
      <div class="row">
        <div class="col-sm-2 col-xs-12">
          <div id="gameInfo">
            <div id="accordion" role="tablist" aria-multiselectable="true">
              <div class="panel panel-default">
                <div class="panel-heading" role="tab" id="headingOne">
                  <h4 class="panel-title">
                            <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                                Collapsible Group Item #1
                            </a>
                        </h4>
                </div>
                <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
                  Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird
                  on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table,
                  raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="col-sm-8 col-xs-12">
          <div id="mainContent">
            <p>Main content will be here at a later point</p>
          </div>
        </div>

        <div class="col-sm-2 col-xs-12">
          <div id="profilePanel">
            <img src="../image/profileicon.png" alt="Profile Icon" width="90" />
            <h3>User Name</h3>
            <p>Useremail@gmail.com</p>
            <p>Number of user victories</p>
          </div>
        </div>

      </div>
    </main>
  </div>
  <div class="container-fluid">
    <footer class="panel-footer">
      <p>&#169; 2016 Copywright of GameSetMatch</p>
    </footer>
  </div>

</body>

</html>
&#13;
&#13;
&#13;

0 个答案:

没有答案