The issue with the Bootstrap slider persists

The slider function in the downloaded html and css codes from bootstrap is not working properly. When clicking the arrow, the screen drops below instead of sliding. Even though the code was copied directly from bootstrap, the issue persists.

<div class="container">
    <div class="row">
        <div class="row">
            <div class="col-md-9">
                <h3>Carousel Product Cart Slider</h3>
            </div>
            <div class="col-md-3">
                <!-- Controls -->
                <div class="controls pull-right hidden-xs">
                    <a class="left fa fa-chevron-left btn btn-success" href="#carousel-example"
                        data-slide="prev"></a>
                    <a class="right fa fa-chevron-right btn btn-success" href="#carousel-example"
                        data-slide="next"></a>
                </div>
            </div>
        </div>
        <div id="carousel-example" class="carousel slide hidden-xs" data-ride="carousel">
            <!-- Wrapper for slides -->
            <div class="carousel-inner">
                <div class="item active">
                    <div class="row">
                        <div class="col-sm-3">
                            <div class="col-item">
                                <div class="photo">
                                    <img src="http://placehold.it/350x260" class="img-responsive" alt="a" />
                                </div>
                                <div class="info">
                                    <div class="row">
                                        <div class="price col-md-6">
                                            <h5>Sample Product</h5>
                                            <h5 class="price-text-color">$199.99</h5>
                                        </div>
                                        <div class="rating hidden-sm col-md-6">
                                            <i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star"></i>
                                            <i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star"></i>
                                            <i class="fa fa-star"></i>
                                        </div>
                                    </div>
                                    <div class="separator clear-left">
                                        <p class="btn-add">
                                            <i class="fa fa-shopping-cart"></i><a href="http://www.jquery2dotnet.com" class="hidden-sm">Add to cart</a></p>
                                        <p class="btn-details">
                                            <i class="fa fa-list"></i><a href="http://www.jquery2dotnet.com" class="hidden-sm">More details</a></p>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                            </div>
                        </div>
                        ... (additional items)
                    </div>
                </div>
            </div>
        </div>
    </div>

css codes

/* carousel */ 
.media-carousel 
{ 
  margin-bottom: 0; 
  padding: 0 40px 30px 40px; 
  margin-top: 30px; 
} 
/* Previous button */ 
.media-carousel .carousel-control.left 
{ 
  left: -12px; 
  background-image: none; 
  background: none repeat scroll 0 0 #222222; 
  border: 4px solid #FFFFFF; 
  border-radius: 23px 23px 23px 23px; 
  height: 40px; 
  width : 40px; 
  margin-top: 30px 
} 
/* Next button */ 
.media-carousel .carousel-control.right 
{ 
  right: -12px !important; 
  background-image: none; 
  background: none repeat scroll 0 0 #222222; 
  border: 4px solid #FFFFFF; 
  border-radius: 23px 23px 23px 23px; 
  height: 40px; 
  width : 40px; 
  margin-top: 30px 
} 
/* Changes the position of the indicators */ 
.media-carousel .carousel-indicators 
{ 
  right: 50%; 
  top: auto; 
  bottom: 0px; 
  margin-right: -19px; 
} 
/* Changes the colour of the indicators */ 
.media-carousel .carousel-indicators li 
{ 
  background: #c0c0c0; 
} 
.media-carousel .carousel-indicators .active 
{ 
  background: #333333; 
} 

.media-carousel img
{
  width: 250px;
  height: 100px
}
/* End carousel */

Answer №1

Kindly incorporate the following CSS and scripts into your solution for it to function properly.

In the head section, include the following script links:

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css" rel="stylesheet"/>

Take a look at the snippet below, which should work well on a full page.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"type="text/css" rel="stylesheet"/>

<div class="container">
    <div class="row">
        <div class="row">
            <div class="col-md-9">
                <h3>
                    Carousel Product Cart Slider</h3>
            </div>
            <div class="col-md-3">
                <!-- Controls -->
                <div class="controls pull-right hidden-xs">
                    <a class="left fa fa-chevron-left btn btn-success" href="#carousel-example"
                        data-slide="prev"></a>
                        <a class="right fa fa-chevron-right btn btn-success" href="#carousel-example"
                            data-slide="next"></a>
                </div>
            </div>
        </div>
        <div id="carousel-example" class="carousel slide hidden-xs" data-ride="carousel">
            <!-- Wrapper for slides -->
            <div class="carousel-inner">
                <div class="item active">
                    <div class="row">
                        <div class="col-sm-3">
                            <div class="col-item">
                                <div class="photo">
                                    <img src="http://placehold.it/350x260" class="img-responsive" alt="a" />
                                </div>
                                <div class="info">
                                    <div class="row">
... (truncated for brevity) ...

JSFiddle Link:

https://jsfiddle.net/6y3za13j/

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Align the text vertically within a list item

<ul style="text-align: center;"> <li style="margin: 0; padding-bottom: 23px; font-size: 32px; vertical-align: middle;"> <div style="font-family: 'Arial','sans-serif'; color: black; font-size: 17px;">[%code1%]</ ...

What is the best way to align the navbar-brand link in the middle of a Bootstrap 4 navigation bar?

This question may seem like a duplicate, but it is not. I am specifically asking about Bootstrap version 4.3 and not any earlier versions. The answers I have found so far are either not applicable to the current version (useless for updated projects), or ...

centering headers using tailwind styles

I am facing a challenge with positioning my main title, logo, and subtitle. I want the subtitle to be centered regardless of the logo's width. Currently, the position of the sub title changes based on the logo's width, resulting in it not aligni ...

Ensure that the footer remains at the bottom of the page without being fixed to the bottom

I am currently working on configuring the footer placement on pages of my website that contain the main body content class ".interior-health-main". My goal is to have a sticky footer positioned at the very bottom of these pages in order to eliminate any wh ...

Designing a logo atop a Jquery tab

In the layout I have designed, there is a header followed by a jQuery Tab navigator. The tabs have padding on the left side, and I want the header image to overlap this area. Currently, the image is hidden behind the tab panel. Which CSS property can be us ...

Is it possible to achieve the same functionality as :first-child by employing :nth-of-type without a selector?

Currently tackling a console warning related to MUI5/emotion (I believe) I have noticed that the pseudo class ":first-child" might pose potential risks during server-side rendering. It may be worth considering replacing it with ":first-of-type". I wonder ...

HTTrack displays an error message indicating that the file cannot be located

After downloading a website using HTTrack with the command below: /usr/local/bin/httrack https://www.website.com -O /Users/mainuser/Desktop/website -n -j I located the index.html file in the website folder and attempted to run it. However, Chrome display ...

Step-by-step guide to applying a CSS class to a grid cell using Syncfusion

Is there a way to define a specific style for a cell using the Syncfusion grid grouping control? I attempted the code below, but it doesn't seem to be effective in my webform. tdescriptor.Columns[0].Appearance.AnyRecordFieldCell.CssClass = "hideColum ...

Methods for incorporating rtl functionality into Angular Chosen

I am currently using Angular with Chosen (source) and I am attempting to implement right-to-left (RTL) support. Here is my demo, but despite referencing resources, I am encountering issues. The main problem arises when the body element has a dir="rtl" att ...

When the Bootstrap carousel slides, enhance the navbar text with motion blur effects

One issue I'm facing is that when the bootstrap carousel changes the image, it adds the class "next" (transform: translate3d(100%, 0, 0); ) to the item and causes motion blur in my navbar menu text. https://i.sstatic.net/kRnb4.png You can check out a ...

Aurelia TypeScript app experiencing compatibility issues with Safari version 7.1, runs smoothly on versions 8 onwards

Our team developed an application using the Aurelia framework that utilizes ES6 decorators. While the app works smoothly on Chrome, Firefox, and Safari versions 8 and above, it encounters difficulties on Safari 7.1. What steps should we take to resolve th ...

What is the best way to hide the jQuery modal I created?

Hello everyone! Currently, I am working on coding a simple JS modal that can be opened and closed smoothly. The issue I am facing is related to adding a click function to (.black-overlay) in order to fade out everything and close the modal. <div class ...

Is it possible to arrange buttons next to each other?

Here is the code for a specific page: HTML: <div class=main> <div class=bttn> <button>abcdef</div> <div class=content> <a href=#!>jksg</a> <a href=#!>jksg</a> & ...

Warning: The DataTables alert has been triggered for table ID DimStatus. It is indicating that an unknown parameter, 'Code', has been requested for row 0 and column 0 during the initialization

https://i.stack.imgur.com/yEpSp.pngI am encountering an error while attempting to display my data in a datatable. The structure of my table is as follows: [Table("DimStatus", Schema = "dmg")] public class PolicyState { [Key] ...

What is the best way to make the first LI elements stand out in a nested structure by applying bold

I had an idea like this: #list li > a { font-weight: bold; } However, I only want the top level items to be made bold, not nested LI's within LI's -- hope that makes sense?? :) EDIT | <ul id="list"> <li><a href="#"& ...

Revamping the website to become a Progressive Web App

I am in the process of transforming my website into a Progressive Web App (PWA) and have made some updates to my code to facilitate this: index.html <script> if('serviceWorker' in navigator) { navigator.serviceWorker.registe ...

Whenever I adjust the size of the div tag, it automatically shifts to the left and loses its responsiveness on mobile devices

This custom class has been created to adjust the size of the div tag and add margins in order to center the elements within the div. .adjust-width { width: 900px; position: center; margin-top: 50px; margin-bottom: 100px; margin-right: 150px; ...

Filtering data within a specific date range on an HTML table using JavaScript

I am attempting to implement a date filtering feature on my HTML table. Users should be able to input two dates (From and To) and the data in the "Date Column" of the table will be filtered accordingly. The inputs on the page are: <input type="date" i ...

Alert iOS that the meta og:image property tag's content has been modified once the page has finished loading

For a web project, I am in the process of integrating og:image tags. The content of the tag gets updated asynchronously after the initial page load, triggered by an HTTP call response. When iOS loads the page, it seems to fetch the tag's content righ ...

What is preventing me from using header() to redirect to the page?

There seems to be an issue with the URL redirection. Instead of redirecting to Activated.php, it is currently showing http://localhost/SP/activation.php/Activated.php instead of http://localhost/SP/Activated.php. <?php require 'db.php'; $msg= ...