How to hide bootstrap slider and all image should be display vertically on mobile device?

user6930268

Is there any way to hide bootstrap slider and all images in slider should be displayed in vertically on the mobile device? I have 5 images in the slider and I have to display all image vertically on a mobile device.I tried in media query below code but it's not working.Please help me in this.

#myCarousel.carousel-inner > .item 
   {
    display: block !important;
   }
Gleb Kemarsky

Bootstrap Carousel on mobile devices

  1. The carousel becomes paused.
  2. The images display vertically.
  3. Each caption is placed under its image. (You can remove the code for the .carousel-caption class if you don't need this feature.)

I've created this solution for a similar issue. Please check is it what you want to achieve?

For Bootstrap 4: https://codepen.io/glebkema/pen/ExxKXZb
For Bootstrap 3: https://codepen.io/glebkema/pen/rLwAWp

var isCarouselPaused = false;

$( window ).on( 'load resize', function() {
  if ( document.documentElement.clientWidth <= 767 ) {
    if ( !isCarouselPaused ) {
      $( '#myCarousel' ).carousel('pause');
      isCarouselPaused = true;
    }
  } else {
      if ( isCarouselPaused ) {
      $( '#myCarousel' ).carousel('cycle');
      isCarouselPaused = false;
    }
};
});
@import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css');

@media (max-width: 767px) {
  .carousel .item {
    display: block;
    margin-top: 12px;
  }
  .carousel-control, 
  .carousel-indicators {
    display: none;
  }
  
  /* Place captions under their slides */
  .carousel-caption {
    color: black;
    position: static;
    text-align: left;
    text-shadow: none;
  }
  
  /* Decorations */  
  .carousel-caption h3 {
    font-weight: bold;
    margin-top: 4px;
    margin-bottom: 8px;
  }
}

/* Make the images wide and responsive. */
.carousel-inner img {
  height: auto;
  width: 100%;
}

/* Decorations */  
.carousel {
  margin-bottom: 20px;
  margin-top: 20px;
}
<div class="container">
  <div class="row">
    <div class="col-xs-12">
    
      <h1>Bootstrap Carousel on mobile devices</h1>
      
      <p>On the narrow screen the carousel is paused and the items display vertically.</p>
      
      <div id="myCarousel" class="carousel slide" data-ride="carousel">
        <ol class="carousel-indicators">
          <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
          <li data-target="#myCarousel" data-slide-to="1"></li>
          <li data-target="#myCarousel" data-slide-to="2"></li>
        </ol>
        <div class="carousel-inner" role="listbox">
          <div class="item active">
            <img src="https://placehold.it/900x300/c69/f9c/?text=1" alt="First slide">
            <div class="carousel-caption">
              <h3>First Header</h3>
              <p>Text text text text text text text.</p>
            </div>
          </div>
          <div class="item">
            <img src="https://placehold.it/900x300/9c6/cf9/?text=2" alt="Second slide">
            <div class="carousel-caption">
              <h3>Second Header</h3>
              <p>Text text text text text text text.</p>
            </div>
          </div>
          <div class="item">
            <img src="https://placehold.it/900x300/69c/9cf/?text=3" alt="Third slide">
            <div class="carousel-caption">
              <h3>Third Header</h3>
              <p>Text text text text text text text.</p>
            </div>
          </div>
        </div>
        <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span><span class="sr-only">Previous</span></a>
        <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span><span class="sr-only">Next</span></a>
      </div>
      
    </div> 
  </div> 
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to display bootstrap slider image full screen without stretching on mobile device using img tag?

From Dev

centering an image in the Bootstrap slider both horizontally and vertically

From Dev

How stylesheets for mobile device should be?

From Dev

How to hide bootstrap modal in mobile

From Dev

How to disable image map on a slider on mobile devices

From Dev

How do I make to fit my HTML element for all mobile device (display)?

From Dev

How to display logo in center at boostrap for mobile device?

From Dev

How to hide parts of text with Bootstrap only for mobile

From Dev

How to hide parts of text with Bootstrap only for mobile

From Java

How to make Bootstrap carousel slider use mobile left/right swipe

From Dev

Hide Bootstrap modal in mobile

From Dev

Slider images do not display on mobile

From Dev

Customized Bootstrap Image Slider

From Dev

Vertical image slider in bootstrap

From Dev

How to make an Image display/hide using a button

From Dev

How to change Image of Bootstrap Carousel on Mobile View?

From Dev

How do I keep an image and text centered vertically with bootstrap?

From Dev

Bootstrap 3 - how to hide input-group-btn on a specific device

From Dev

Bootstrap 3 - how to hide input-group-btn on a specific device

From Dev

How to disable bootstrap data-spy on mobile device? (smaller resolution)

From Dev

how to hide one column from grid in bootstrap mobile version

From Dev

How to pass and set the slider image display time in jQuery?

From Dev

How to use a Matlab GUI slider to display image timeframes

From Dev

Forcing desktop display on a mobile device

From Dev

How to change the background-image of the full slider - bootstrap

From Dev

How to hide image when resizing using max-device-width?

From Dev

How to hide image when resizing using max-device-width?

From Dev

hide column in bootstrap on mobile phone

From Dev

bootstrap - Hide Mobile Menu(navbar)

Related Related

  1. 1

    How to display bootstrap slider image full screen without stretching on mobile device using img tag?

  2. 2

    centering an image in the Bootstrap slider both horizontally and vertically

  3. 3

    How stylesheets for mobile device should be?

  4. 4

    How to hide bootstrap modal in mobile

  5. 5

    How to disable image map on a slider on mobile devices

  6. 6

    How do I make to fit my HTML element for all mobile device (display)?

  7. 7

    How to display logo in center at boostrap for mobile device?

  8. 8

    How to hide parts of text with Bootstrap only for mobile

  9. 9

    How to hide parts of text with Bootstrap only for mobile

  10. 10

    How to make Bootstrap carousel slider use mobile left/right swipe

  11. 11

    Hide Bootstrap modal in mobile

  12. 12

    Slider images do not display on mobile

  13. 13

    Customized Bootstrap Image Slider

  14. 14

    Vertical image slider in bootstrap

  15. 15

    How to make an Image display/hide using a button

  16. 16

    How to change Image of Bootstrap Carousel on Mobile View?

  17. 17

    How do I keep an image and text centered vertically with bootstrap?

  18. 18

    Bootstrap 3 - how to hide input-group-btn on a specific device

  19. 19

    Bootstrap 3 - how to hide input-group-btn on a specific device

  20. 20

    How to disable bootstrap data-spy on mobile device? (smaller resolution)

  21. 21

    how to hide one column from grid in bootstrap mobile version

  22. 22

    How to pass and set the slider image display time in jQuery?

  23. 23

    How to use a Matlab GUI slider to display image timeframes

  24. 24

    Forcing desktop display on a mobile device

  25. 25

    How to change the background-image of the full slider - bootstrap

  26. 26

    How to hide image when resizing using max-device-width?

  27. 27

    How to hide image when resizing using max-device-width?

  28. 28

    hide column in bootstrap on mobile phone

  29. 29

    bootstrap - Hide Mobile Menu(navbar)

HotTag

Archive