Bootstrap 4 beta vertical carousel

I am trying to use a vertical carousel that I saw an example of here. That one is using images, but I only want to scroll text. I tried the following code but the carousel doesn’t scroll, I only see the text below my section of logos with the light yellow background. How can I make this scroll the quotes rather than just show them all the way it is? This is the live test page.

.carousel-inner.vertical {
  height: 100%; /*Note: set specific height here if not, there will be some issues with IE browser*/
}
.carousel-inner.vertical > .item {
  -webkit-transition: .6s ease-in-out top;
  -o-transition: .6s ease-in-out top;
  transition: .6s ease-in-out top;
}

@media all and (transform-3d),
(-webkit-transform-3d) {
  .carousel-inner.vertical > .item {
    -webkit-transition: -webkit-transform .6s ease-in-out;
    -o-transition: -o-transform .6s ease-in-out;
    transition: transform .6s ease-in-out;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
  }
  .carousel-inner.vertical > .item.next,
  .carousel-inner.vertical > .item.active.right {
    -webkit-transform: translate3d(0, 33.33%, 0);
    transform: translate3d(0, 33.33%, 0);
    top: 0;
  }
  .carousel-inner.vertical > .item.prev,
  .carousel-inner.vertical > .item.active.left {
    -webkit-transform: translate3d(0, -33.33%, 0);
    transform: translate3d(0, -33.33%, 0);
    top: 0;
  }
  .carousel-inner.vertical > .item.next.left,
  .carousel-inner.vertical > .item.prev.right,
  .carousel-inner.vertical > .item.active {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    top: 0;
  }
}

.carousel-inner.vertical > .active {
  top: 0;
}
.carousel-inner.vertical > .next,
.carousel-inner.vertical > .prev {
  top: 0;
  height: 100%;
  width: auto;
}
.carousel-inner.vertical > .next {
  left: 0;
  top: 33.33%;
  right:0;
}
.carousel-inner.vertical > .prev {
  left: 0;
  top: -33.33%;
  right:0;
}
.carousel-inner.vertical > .next.left,
.carousel-inner.vertical > .prev.right {
  top: 0;
}
.carousel-inner.vertical > .active.left {
  left: 0;
  top: -33.33%;
  right:0;
}
.carousel-inner.vertical > .active.right {
  left: 0;
  top: 33.33%;
  right:0;
}

#carousel-pager .carousel-control.left {
    bottom: initial;
    width: 100%;
}
#carousel-pager .carousel-control.right {
    top: initial;
    width: 100%;
}

<div class="container">
    
<div class="row">

<div class="col">
            
<div id="carousel-pager" class="carousel slide " data-ride="carousel" data-interval="1000">
                
<!-- Carousel items -->
                
<div class="carousel-inner vertical">
                    
<div class="active item">
                        
<blockquote class="blockquote">
<p>In A Very Short Period of Time Our Level of Guest Service & Professionalism Has Dramatically Improved...You Built A Much Stronger And Confident Team.</p>
<footer class="blockquote-footer"><cite>Lynn W. Smith, General Manager<br>
Smuggler's Inn</cite></footer>
</blockquote>	              
</div>
                    
<div class="item">
                        
<blockquote class="blockquote">
<p>"I can still remember some of Pete's lessons years later!   He was inspiring & he knew what he was talking about. I also felt he was genuine.  He seemed to really care about our getting better."</p>
<footer class="blockquote-footer"><cite>Vern Stone, Sr., Transportation & Valet Services<br>
Lake of the Tourches Resort Casino</cite></footer>
</blockquote>             
</div>
                    
<div class="item">
                        
<blockquote class="blockquote">
<p>Peter Scott's Programs Are All About Content & Core Values.</p>
<footer class="blockquote-footer"><cite>Dr. Thomas Dullien, Executive Director Human Resources & HR Development<br>
Barona Resort & Casino</cite></footer>
</blockquote>              
</div>
     
<div class="item">
                        
<blockquote class="blockquote">
<p>Peter Scott's Programs Are All About Content & Core Values.</p>
<footer class="blockquote-footer"><cite>Dr. Thomas Dullien, Executive Director Human Resources & HR Development<br>
Barona Resort & Casino</cite></footer>
</blockquote>              
</div>
         
</div>
  
<div class="item">
                        
<blockquote class="blockquote">
<p>I Was Skeptical About This Experiential Training, But It Was Phenomenal!</p> 
<footer class="blockquote-footer"><cite>Ana Zysko, Director of Training<br>
Inn Of The Mountain Gods Resort & Casino</cite></footer>
</blockquote>              
</div>
 
<div class="item">
                        
<blockquote class="blockquote">
<p>Your Customer Service Training On November 11, 2003, Was One Of The Best Training Events I Have Ever Experienced!</p>
<footer class="blockquote-footer"><cite>Robert Taschetta, Help Desk Manager<br>
Best Western International</cite></footer>
</blockquote>               
</div>

<div class="item">
                        
<blockquote class="blockquote">
<p>It Was One Of The Best Trainings I've Ever Seen.  Our Gaming Board Attended A Session And Just Loved It!</p>
<footer class="blockquote-footer"><cite>Marcus Diaz, Director of Training<br>
Casino Del Sol</cite></footer>
</blockquote>               
</div>
         
<div class="item">
                        
<blockquote class="blockquote">
<p>Several Commented On How Mr. Scott Conveyed A Sense of Understanding And Genuine Desire To Provide Them With Concrete And Realistic Answers To The Questions And Concerns.</p>
<footer class="blockquote-footer"><cite>Maria Meza, Training & Development Manager<br>
Tohono O'odham Gaming Authority</cite></footer>
</blockquote>            
</div>
 

<div class="item">
                        
<blockquote class="blockquote">
<p>Since Our Seminar, Our Management Team Has Taken More Responsibility In Working With All New Hires.</p>
<footer class="blockquote-footer"><cite>Dominic R. Palmiers, CEO<br>
Odyssey Foods, LLC</cite></footer>
</blockquote>
            
</div>
            
<div class="item">
                
<blockquote class="blockquote">
<p>&quot;Our Most Concise Training To Date!</p>
<footer class="blockquote-footer"><cite>John Comeau<br>
Mohegan Sun Casino</cite></footer>
</blockquote>        
</div>
              
</div>
                
                
<!-- Controls -->
                
<a class="left carousel-control" href="#carousel-pager" role="button" data-slide="prev">
                    
<span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>
                   
 <span class="sr-only">Previous</span>
                
</a>
                
<a class="right carousel-control" href="#carousel-pager" role="button" data-slide="next">
                    
<span class="chevron-circle-down" aria-hidden="true"></span>
                    
<span class="sr-only">Next</span>
                
</a>
           
</div></div></div>
$('.carousel .vertical .item').each(function(){
  var next = $(this).next();
  if (!next.length) {
    next = $(this).siblings(':first');
  }
  next.children(':first-child').clone().appendTo($(this));
  
  for (var i=1;i<2;i++) {
    next=next.next();
    if (!next.length) {
    	next = $(this).siblings(':first');
  	}
    
    next.children(':first-child').clone().appendTo($(this));
  }
});

If I add the css from the bootply and change the classes on the html to match the demo then it works for me.

Working example:


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../../../../favicon.ico">
<title>Peter Scott's Competitive Edge</title>

<!-- Bootstrap core CSS -->

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<!-- Custom styles for this template -->

<link href="http://pscompetitiveedge.com/css/custombs4-2.css" rel="stylesheet">
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
<!-- Font Awesome JS -->
<script src="https://use.fontawesome.com/a0aac8df13.js"></script>
<!-- Search Engine -->
<meta name="author" content="Peter Scott">
<meta name="robots" content="index, follow">
<meta name="DESCRIPTION" content="Peter trains regularly on the subjects of Leadership, Team Building, Customer Service, Sales Enhancement, Creating a More Positive and Fun Workplace, Conflict Resolution and the Pursuit of Excellence.">
<meta name="KEYWORDS" content="corporate training, training and development, peter scott, corporate magic, fire walking, professional speakers, training, competitive edge, leadership, customer service, seminars, workshops, customer service training, leadership training, Casino, Gaming, Property, Hard Rock, Gambling, Hospitality, Hotel, Consulting, Development, Food and beverage, Hotel, Frontline, Team, Teambuilding, Property, Customer service, Moneyback, Reasonable Rates, Testimonial Video, Native American, Life lesson, Team bonding, Feedback, Skill sets, Inn of the Mountain Gods Resort &amp; Casino, Positive, Attitude, Retention, Interactive, Role play, Enhancement, Unique, Dynamic, Participants, Game show, Engages">
<meta name="image" content="http://www.pscompetitiveedge.com/images/Banner.jpg">

<style>
.vert .carousel-item-next.carousel-item-left,
.vert .carousel-item-prev.carousel-item-right {
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
}
.vert .carousel-item-next,
.vert .active.carousel-item-right {
    -webkit-transform: translate3d(0, 100%, 0);
            transform: translate3d(0, 100% 0);
}

.vert .carousel-item-prev,
.vert .active.carousel-item-left {
-webkit-transform: translate3d(0,-100%, 0);
        transform: translate3d(0,-100%, 0);
}

</style>
</head>

<body>
<div class="container">
  <div class="row">
    <div class="col">
      <div id="carousel-pager" class="carousel vert slide " data-ride="carousel" data-interval="1000"> 
        
        <!-- Carousel items -->
        
        <div class="carousel-inner vertical">
          <div class="active  carousel-item item">
            <blockquote class="blockquote">
              <p>In A Very Short Period of Time Our Level of Guest Service & Professionalism Has Dramatically Improved...You Built A Much Stronger And Confident Team.</p>
              <footer class="blockquote-footer"><cite>Lynn W. Smith, General Manager<br>
                Smuggler's Inn</cite></footer>
            </blockquote>
          </div>
          <div class=" carousel-item item">
            <blockquote class="blockquote">
              <p>"I can still remember some of Pete's lessons years later!   He was inspiring & he knew what he was talking about. I also felt he was genuine.  He seemed to really care about our getting better."</p>
              <footer class="blockquote-footer"><cite>Vern Stone, Sr., Transportation & Valet Services<br>
                Lake of the Tourches Resort Casino</cite></footer>
            </blockquote>
          </div>
          <div class=" carousel-item item">
            <blockquote class="blockquote">
              <p>Peter Scott's Programs Are All About Content & Core Values.</p>
              <footer class="blockquote-footer"><cite>Dr. Thomas Dullien, Executive Director Human Resources & HR Development<br>
                Barona Resort & Casino</cite></footer>
            </blockquote>
          </div>
          <div class=" carousel-item item">
            <blockquote class="blockquote">
              <p>Peter Scott's Programs Are All About Content & Core Values.</p>
              <footer class="blockquote-footer"><cite>Dr. Thomas Dullien, Executive Director Human Resources & HR Development<br>
                Barona Resort & Casino</cite></footer>
            </blockquote>
          </div>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>I Was Skeptical About This Experiential Training, But It Was Phenomenal!</p>
            <footer class="blockquote-footer"><cite>Ana Zysko, Director of Training<br>
              Inn Of The Mountain Gods Resort & Casino</cite></footer>
          </blockquote>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>Your Customer Service Training On November 11, 2003, Was One Of The Best Training Events I Have Ever Experienced!</p>
            <footer class="blockquote-footer"><cite>Robert Taschetta, Help Desk Manager<br>
              Best Western International</cite></footer>
          </blockquote>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>It Was One Of The Best Trainings I've Ever Seen.  Our Gaming Board Attended A Session And Just Loved It!</p>
            <footer class="blockquote-footer"><cite>Marcus Diaz, Director of Training<br>
              Casino Del Sol</cite></footer>
          </blockquote>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>Several Commented On How Mr. Scott Conveyed A Sense of Understanding And Genuine Desire To Provide Them With Concrete And Realistic Answers To The Questions And Concerns.</p>
            <footer class="blockquote-footer"><cite>Maria Meza, Training & Development Manager<br>
              Tohono O'odham Gaming Authority</cite></footer>
          </blockquote>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>Since Our Seminar, Our Management Team Has Taken More Responsibility In Working With All New Hires.</p>
            <footer class="blockquote-footer"><cite>Dominic R. Palmiers, CEO<br>
              Odyssey Foods, LLC</cite></footer>
          </blockquote>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>&quot;Our Most Concise Training To Date!</p>
            <footer class="blockquote-footer"><cite>John Comeau<br>
              Mohegan Sun Casino</cite></footer>
          </blockquote>
        </div>
      </div>
      
      <!-- Controls --> 
      
      <a class="left carousel-control" href="#carousel-pager" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#carousel-pager" role="button" data-slide="next"> <span class="chevron-circle-down" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div>
  </div>
</div>
<a href="#" class="back-to-top" style="display: inline;"> <i class="fa fa-arrow-circle-up"></i> </a>
<footer class="footer">
  <div class="container">
    <div class="text-center">Copyright &copy; <script>document.write(new Date().getFullYear());</script> Peter Scott's Competitive Edge</div>
  </div>
</footer>
</body>
</html>

You’ll probably need to give the text block a white background colour or you will get overlaid text as it traverses upwards.

1 Like

Thanks Paul, that is awesome! How can I change it so only one quote shows at a time and then the next one scrolls up??

Isn’t that what it is doing in my demo?

Or did I misunderstand ?

It shows 3 quotes and one does scroll up
What I’m hoping for is for only one quote to show and then the next scrolls up and so on. Here is a screenshot of it live here


where to host images

You are putting 3 blockquotes in every carousel item so it scrolls all three.

The html I showed above just has one blockquote in each item and it just scrolls one of them. I suggest you change the html as per the snippet I posted and try again.

Unless I misunderstood what you were trying to do of course :slight_smile:

changing my javascript to this solved my problem

$('.carousel .vertical .item').each(function(){
  var next = $(this).next();
  if (!next.length) {
    next = $(this).siblings(':first');
  }
});
1 Like

I tried to modify the code of my working vertical carousel to add a previous and next button under the slider, It seems to have messed things up, It looks like the below image, how I want it to appear. How can I fix this? I am trying allow the user to be able to control the scroll of the quotes.

I made a codepen here too if you need to see

<div class="container">
  <div class="row">
    <div class="col">
      <div id="carousel-pager" class="carousel vert slide " data-ride="carousel" data-interval="1000"> 
        
        <!-- Carousel items -->
        
        <div class="carousel-inner vertical">
          <div class="active  carousel-item item">
            <blockquote class="blockquote">
              <p>In A Very Short Period of Time Our Level of Guest Service & Professionalism Has Dramatically Improved...You Built A Much Stronger And Confident Team.</p>
              <footer class="blockquote-footer"><cite>Lynn W. Smith, General Manager<br>
                Smuggler's Inn</cite></footer>
            </blockquote>
          </div>
          <div class=" carousel-item item">
            <blockquote class="blockquote">
              <p>"I can still remember some of Pete's lessons years later!   He was inspiring & he knew what he was talking about. I also felt he was genuine.  He seemed to really care about our getting better."</p>
              <footer class="blockquote-footer"><cite>Vern Stone, Sr., Transportation & Valet Services<br>
                Lake of the Tourches Resort Casino</cite></footer>
            </blockquote>
          </div>
          <div class=" carousel-item item">
            <blockquote class="blockquote">
              <p>Peter Scott's Programs Are All About Content & Core Values.</p>
              <footer class="blockquote-footer"><cite>Dr. Thomas Dullien, Executive Director Human Resources & HR Development<br>
                Barona Resort & Casino</cite></footer>
            </blockquote>
          </div>
          <div class=" carousel-item item">
            <blockquote class="blockquote">
              <p>Peter Scott's Programs Are All About Content & Core Values.</p>
              <footer class="blockquote-footer"><cite>Dr. Thomas Dullien, Executive Director Human Resources & HR Development<br>
                Barona Resort & Casino</cite></footer>
            </blockquote>
          </div>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>I Was Skeptical About This Experiential Training, But It Was Phenomenal!</p>
            <footer class="blockquote-footer"><cite>Ana Zysko, Director of Training<br>
              Inn Of The Mountain Gods Resort & Casino</cite></footer>
          </blockquote>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>Your Customer Service Training On November 11, 2003, Was One Of The Best Training Events I Have Ever Experienced!</p>
            <footer class="blockquote-footer"><cite>Robert Taschetta, Help Desk Manager<br>
              Best Western International</cite></footer>
          </blockquote>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>It Was One Of The Best Trainings I've Ever Seen.  Our Gaming Board Attended A Session And Just Loved It!</p>
            <footer class="blockquote-footer"><cite>Marcus Diaz, Director of Training<br>
              Casino Del Sol</cite></footer>
          </blockquote>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>Several Commented On How Mr. Scott Conveyed A Sense of Understanding And Genuine Desire To Provide Them With Concrete And Realistic Answers To The Questions And Concerns.</p>
            <footer class="blockquote-footer"><cite>Maria Meza, Training & Development Manager<br>
              Tohono O'odham Gaming Authority</cite></footer>
          </blockquote>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>Since Our Seminar, Our Management Team Has Taken More Responsibility In Working With All New Hires.</p>
            <footer class="blockquote-footer"><cite>Dominic R. Palmiers, CEO<br>
              Odyssey Foods, LLC</cite></footer>
          </blockquote>
        </div>
        <div class=" carousel-item item">
          <blockquote class="blockquote">
            <p>&quot;Our Most Concise Training To Date!</p>
            <footer class="blockquote-footer"><cite>John Comeau<br>
              Mohegan Sun Casino</cite></footer>
          </blockquote>
        </div>
      </div>
<section class="carousel slide" data-ride="carousel" id="postsCarousel">
    <div class="container">
        <div class="row ">
           <div class="col-xs-12 mx-auto mb-3">
           <a class="left carousel-control btn btn-outline-secondary prev" href="#carousel-pager" data-slide="prev">
           <i class="fa fa-lg fa-chevron-up"></i> Previous Quote<span class="sr-only">Previous Quote</span></a>
           <a class="right carousel-control btn btn-outline-secondary next" href="#carousel-pager" data-slide="next">
           <i class="fa fa-lg fa-chevron-down"></i> Next Quote<span class="sr-only">Next Quote</span></a>
            </div></div></div>
</section>
</div>

.vert .carousel-item-next.carousel-item-left,
.vert .carousel-item-prev.carousel-item-right {
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
}
.vert .carousel-item-next,
.vert .active.carousel-item-right {
    -webkit-transform: translate3d(0, 100%, 0);
            transform: translate3d(0, 100% 0);
}

.vert .carousel-item-prev,
.vert .active.carousel-item-left {
-webkit-transform: translate3d(0,-100%, 0);
        transform: translate3d(0,-100%, 0);
}
$('.carousel .vertical .item').each(function(){
  var next = $(this).next();
  if (!next.length) {
    next = $(this).siblings(':first');
  }
  next.children(':first-child').clone().appendTo($(this));
  
  for (var i=1;i<2;i++) {
    next=next.next();
    if (!next.length) {
    	next = $(this).siblings(':first');
  	}
    
    next.children(':first-child').clone().appendTo($(this));
  }
});

Should I make a new thread for this question?

I’ve moved this to the JS forum as it seems to be a JS question now.

Note that in your codepen you haven’t included jquery in the settings (jquery must be first in line).

thanks I just added the jquery in the codepen

EDIT that also solved my problem on my page too, thank you

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.