Disable the functionality of the next and previous buttons for the Bootstrap carousel when clicking on the outer

Here is the code for the carousel:

The next/prev button functions under its respective div, how can I stop it?

When I click on the div below the carousel, the carousel continues to move as usual.

Below the carousel div, there is another one with a tabbing system. When I click on any tab, the carousel slide moves but I want to stop it. I believe it's due to overlapping divs.

Answer №1

It seems like you were just missing a few elements of the bootstrap syntax in your code. I compared it side by side with

http://www.w3schools.com/bootstrap/bootstrap_carousel.asp

Could you please check if the following snippet works?

<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" rel="stylesheet"/>

<div class="carousel slide" id="myCarousel" data-ride="carousel" data-interval="false" style=" border-top: 4px solid #ccc;">
            <div class="carousel-inner" role="listbox" style=" margin-top: 20px;">
                <div class="item active ">
                        <ul class="thumbnails">
                           <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thomes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                          <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thomes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                           <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thomes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                            
                           <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thomes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                            <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thomes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                             <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thosmes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                        </ul>
                  </div><!-- /Slide1 --> 
              <div class="item ">
                        <ul class="thumbnails">
                           <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thomes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                          <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thomes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                           <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thomes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                            
                           <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thomes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                            <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thomes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                             <li class="col-sm-4 col-md-2 col-xs-12 ">
        <div class="fff">
                                                        <div class="caption">
     
                                                                        <a href="#"><img class="img-responsive" src="<?php echo base_url()?>assets/images/css.jpg" alt=""></a>
                                                                     
                                                                        <strong>Praesent commodo Nibh Etiam Sem Nullam</strong><br>
                                                                        <strong style=" color:#029f5b;"> Alxender Thosmes</strong><br>
     Nullam Condimentum Nibh Etiam Sem no inquiry so cordial   
    <a class="" href="#">» Read More</a>
    </div>
                                </div>
                            </li>
                        </ul>
                  </div><!-- /Slide2 --> 
            
            </div>
           
       <nav>
    <ul class="control-box pager" >
    <li><a data-slide="prev" role="button" href="#myCarousel" class="left"><i class="glyphicon glyphicon-chevron-left"></i></a></li>
    <li><a data-slide="next" role="button" href="#myCarousel" class="right"><i class="glyphicon glyphicon-chevron-right"></li>
    </ul>
    </nav>
       <!-- /.control-box -->   
                                  
        </div>

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

What is the best way to organize JSON files data in a specific sequence?

I successfully converted 3 JSON files into an HTML page using AngularJS. Here is the code I used: Factory code app.factory('myapp', ['$http', function($http) { function getLists() { var tab = ['url1', 'url2 ...

Text element in SVG not displaying title tooltip

Looking for a solution to display a tooltip when hovering over an SVG Text element? Many sources suggest adding a Title element as the first child of the SVG element. This approach seems to work in Chrome, but not in Safari - the primary browser used by mo ...

The background color of the body is being utilized by Div in Internet Explorer version 7

Within my HTML document, I have created a container div that holds several nested divs for a slideshow effect. This "container" div is positioned over the background image of the body element. The CSS styling for the body element is as follows: body { ba ...

Choose the camera when utilizing the navigate.getUserMedia() function

I am currently utilizing the navigate.getUserMedia() method to record video on my mobile device and perform additional processing on it. However, at the moment, it is only capturing video using the front camera. How can I make it switch to the rear facing ...

Transform the assurance into a JSON entity

Currently facing an issue with converting the promise returned by the service to the controller. My goal is to generate an array of JSON objects using the data within the promise. In the controller, this is what I'm receiving: https://i.stack.imgur.co ...

Emscripten WebAssembly: Issue with Exporting Class "Import #13 module="GOT.func" error: the module does not exist as an object or function"

Exploring the potential of WebAssembly in a project as an importable function module, I decided to dive into using C++ with Emscripten. Implementing functions was smooth sailing, but running into obstacles when it comes to classes. My goal is to expose and ...

Attempting to implement an onclick event on an image object in mobile Safari on iPhone, but unfortunately encountering difficulties in the process

I am attempting to dynamically add some objects to a div and then programmatically initiate a click event on the first image once they have all been created. The code below is successful in doing this on Firefox for PC, however, when testing it on an iPhon ...

Designing a dropdown menu within displaytag

I am currently utilizing displaytag to present tabular data, but I aspire to design a user interface akin to "kayak.com" where clicking on a row reveals additional details without refreshing the page. Here is an example scenario before clicking the Detail ...

The variablewidth feature in Slick Carousel is malfunctioning

I've integrated slick slider 1.8.1 into my Rails app (v.5.2.0) and I'm encountering an issue with variablewidth set to true. My expectation was to achieve a layout similar to the example shown here: However, what's happening in my case is t ...

Windows authentication login only appears in Chrome after opening the developer tools

My current issue involves a React app that needs to authenticate against a windows auth server. To achieve this, I'm hitting an endpoint to fetch user details with the credentials included in the header. As per my understanding, this should trigger th ...

Having issues with the CSS dropdown menu not activating when hovering

I am facing an issue with a simple menu that includes a dropdown feature upon hovering. The code works perfectly fine in Fiddle, however, it fails to work when running the entire page locally on IE. Can someone please assist me? (here's my code at fi ...

The error message for validating my form magically disappears

I've been working on creating a registration form using HTML, Bootstrap, and JavaScript. My goal was to display an error message when a field is left empty, but for some reason, the error message appears briefly and disappears afterwards. I can't ...

When a link is clicked, it quickly blinks or flashes on the screen

<div class="collapse navbar-toggleable-xs" id="exCollapsingNavbar2"> <%= link_to 'FARDIN KHANJANI', root_path, class: 'navbar-brand logo' %> </div> Upon viewing the gif I included, you may notice that a flash oc ...

Checking for the Existence of a Database Table in HTML5 Local Storage

Upon each visit to my page, I automatically generate a few local database tables if they do not already exist. Subsequently, I retrieve records from the Actual Database and insert them into these newly created local tables. I am wondering if there is a me ...

Utilizing MVC Razor and Ajax.BeginForm to dynamically update elements upon successful form submission

In my MVC search form, there is a date field that includes "-" and "+" buttons to navigate to the previous or next day, triggering a search each time. The issue I am facing is that when the -/+ button is clicked, it sends the current form data to the cont ...

Update the nested radio button to a new value

I have a series of radio button lists generated using ng-repeat. I've managed to capture the selected item successfully. Now, I am attempting to set the default value for the radio buttons. Could someone please provide assistance? Below is my code sni ...

Sending an Ajax POST request from a Node.js server

I am running a Node.js server with Socket.IO that communicates with a Python server using Django. I am looking to make a POST request from the Node.js server to the Django server on a specific method without utilizing any jQuery functions due to their depe ...

I'm having trouble getting my login page centered when using Semantic UI

Currently, I am working on creating a login page using Semantic UI. However, I am facing an issue where the column is not aligning to the center as intended; instead, it is occupying the entire page. I have attempted to link all the necessary files in the ...

Is it possible to create a carousel using PHP and MySQL?

Is it really impossible? I'm determined to pull images from a MySQL database and create a carousel similar to the one showcased in this link: . However, my goal is to achieve this using only HTML, CSS, PHP, and MySQL. ...

When utilizing AJAX XMLHttpRequest, the concatenated response text from Symfony's StreamedResponse becomes apparent

Below is the code for a controller that returns Line 1 as soon as the endpoint is called and then two seconds later it returns Line 2. When accessing the URL directly at http://ajax.dev/app_dev.php/v2, everything works as expected. /** * @Method({"GET"}) ...