spacing
spacing

Reputation: 780

Individual scroll panel for each column with bootstrap not working

I am using bootstrap to create a website from scratch, it's the first time I use bootstrap so I might be doing something wrong.

I am trying to implement a individual scroll panel for each of the 3 content columns, and it doesn't appear to be working as the scroll appears but grayed out and not working properly

I pasted the code below using stackoverflow html app but some elements are not displaying properly so here is a link to the fully working site as of now

body {
  padding-top: 159px;
  overflow: hidden;
}

html {
  overflow: hidden;
}

#navbar_right {}

.container {}

#categorias {
  background-color: #171717;
  overflow: scroll;
  height: 100%;
}

#content {
  background-color: #ffffff;
}

.btn {
  border-radius: 0;
}

.cat {
  margin: 10% 0% 10% 15%;
  position: relative;
  z-index: 1;
}

#right-bar {
}


/* Menu Top Navbar */

.button {
  position: relative;
  background-color: inherit;
  border: none;
  font-size: 16px;
  font-family: Roboto;
  color: #ffffff;
  padding: 20px;
  width: 200px;
  text-align: center;
  -webkit-transition-duration: 0.4s;
  /* Safari */
  transition-duration: 0.4s;
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
  outline: 0;
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
}

.button:hover {
  -webkit-filter: grayscale(0%);
  filter: grayscale(0%);
}

.button:after {
  content: "";
  background: #ffffff;
  display: block;
  position: absolute;
  padding-top: 300%;
  padding-left: 350%;
  margin-left: -20px!important;
  margin-top: -120%;
  opacity: 0;
  transition: all 0.8s
}

.button:active:after {
  padding: 0;
  margin: 0;
  opacity: 1;
  transition: 0s
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!DOCTYPE html>
<html>

<head>
  <title>ComISTo Grupo 3</title>
  <meta charset="utf-8" />
  <!-- Latest compiled and minified CSS -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  <!-- Optional theme -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
  <!-- Latest compiled and minified JavaScript -->
  <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyhttp://stackoverflow.com/questions/ask#jSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.1/css/mdb.min.css">
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.1/js/mdb.min.js"></script>
  <link href='https://fonts.googleapis.com/css?family=Roboto:300,400,700' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" type="text/css" href="main.css">

</head>

<body>
  <!-- Fixed navbar -->
  <nav class="navbar navbar-inverse navbar-fixed-top">
    <header class="container">
      <div class="navbar-header">
        
        <a class="navbar-brand" href="#">ComISTo</a>
      </div>
      <div id="navbar_right" class="navbar-collapse collapse">
        <ul class="nav navbar-nav navbar-right">
          <!-- NavBar Buttons -->
          <li><button class="button" type="button" onclick="window.location='#'; class=" active ";"><img src="images/empregado.png"/><br/>Chamar Empregado</button></li>
          <li><button class="button" type="button" onclick="window.location='#'; class=" active ";"><img src="images/pagar.png"/></br>Pagar</button></li>
          <li><button class="button" type="button" onclick="window.location='#'; class=" active ";"><img src="images/ajuda.png"/><br/>Ajuda</button></li>
        </ul>
      </div>
    </header>
  </nav>
  <div class="container-fluid">
    <!-- Content -->
    <div class="row">
      <!-- Sidebar -->
      <div class="col-md-2" id="categorias">
        <a href="#" class="cat btn btn-default waves-effect waves-light"><img src="images/broccoli.png" /></br> Vegetariano</a>
        <a href="#" class="cat btn btn-default waves-effect waves-light"><img src="images/steak.png" /></br> Carne</a>
        <a href="#" class="cat btn btn-default waves-effect waves-light"><img src="images/fish.png" /></br> Peixe</a>
        <a href="#" class="cat btn btn-default waves-effect waves-light"><img src="images/glass.png" /></br> Vinhos</a>
        <a href="#" class="cat btn btn-default waves-effect waves-light"><img src="images/ice-cream.png" /></br> Sobremesa</a>
      </div>
      <div class="col-md-6" id="content">
      </div>
      <div class="col-md-4" id="rightbar"></div>
    </div>
  </div>
</body>

</html>

Upvotes: 0

Views: 146

Answers (1)

Jordi Ruiz
Jordi Ruiz

Reputation: 487

I think that the problem is that the height of the #categorias column is set to 100%, you should give a specific height. Try something like:

#categorias {
  height: 400px 
}

Upvotes: 1

Related Questions