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

In IE8, the section cannot extend to full width

Having some trouble with a section in the footer of a website I'm developing - it won't go full width in IE8. I've tried all sorts of solutions but nothing seems to work. Can anyone else take a look and see if there's something I'v ...

The fixed positioned div with jQuery disappears when scrolling in Firefox but functions properly in Chrome, IE, and Safari

Click here to see a div located at the bottom of the right sidebar that is supposed to behave as follows: As you scroll down the page, the div should change its class and become fixed at the top of the screen until you reach the bottom of the parent el ...

Vue's smooth scrolling in Nuxt.js was not defined due to an error with the Window

There seems to be an issue with adding vue smooth scroll to my nuxt.js project as I'm encountering the "window is not defined error". The steps I followed were: yarn add vue2-smooth-scroll Within the vue file, I included: import Vue from 'vue ...

Leveraging the power of PHP includes with nested subdirectories

Hello, I recently configured my web server to run all .html files as .php files, allowing me to utilize the php include function, which has been very beneficial. However, I have various subdirectories with multiple files in each one. Homepage --banners ...

Updating the query parameters/URL in Node.js's request module

In my Express.js application, I am utilizing the npm request module to interact with an internal API. The options passed to the request function are as follows: requestOptions = { url : http://whatever.com/locations/ method : "GET", json : {}, qs : { ...

Is Javascript automatically generated by asp.net?

If I were to initialize a fresh VS project and paste the subsequent sample code into a freshly created page default.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="WebApplication1._default" %> <!DOCTYPE ...

Is it possible to dynamically change a form's input value using a JavaScript keyup function based on input from other form elements?

My form utilizes the keyup function to calculate the total value of 3 input fields by multiplying them and displaying the result. Below is a fiddle showcasing this functionality: $(document).ready(function () { $(".txtMult1 input").keyup(multInp ...

Transforming JSON in Node.js based on JSON key

I am having trouble transforming the JSON result below into a filtered format. const result = [ { id: 'e7a51e2a-384c-41ea-960c-bcd00c797629', type: 'Interstitial (320x480)', country: 'ABC', enabled: true, ...

Lack of coherence in events

Currently, I am learning JS and WebApi.Net. One issue that I am facing is that part_2 is sometimes executed before part_1, even though it should be the other way around. //**** <part_1> **** var link = 'api/Values', ttMass = new Array(); ...

Identifying the selected element with jQuery

Let's say I have a form that includes both inputs and textareas. How can I determine which one is currently selected or clicked on? $('body').on('change', 'input textarea', function() { }) In simpler terms, ...

Is there a way to avoid reaching the limit of 150 JSON calls per hour allowed by the Twitter API and prevent Twitter from dropping unnecessary cookies?

I currently have a Twitter feed integrated on my website using the jquery tweet plugin from tweet.seaofclouds.com along with other json plugins that fetch data from a third-party website. The issue I'm facing is that the Twitter API restricts the num ...

Move the div with jQuery

I am currently working on making a div draggable without relying on jQuery UI. Here is the HTML code: <div class="wrapper"> <div class="toddler"></div> </div> And here is the script I have written: $.fn.slider = function () { ...

Bootstrap 5 dropdown toggle displaying incorrect menu

I am currently working on a website project using Bootstrap 5. In the navigation bar of my site, I have implemented a dropdown menu with multiple submenus that dropend. <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" ...

Tips for aligning buttons in a row

I am trying to find a way to make my buttons more compact within a <div> element when the length exceeds 100%. Is there a way to achieve this while avoiding wrapping to a second line? Is there a solution similar to using scaleX, but one that takes i ...

Best practices for authenticating methods with Google signin in Angular projects

I have made significant progress towards getting the Google signin feature to work, reaching 95% completion. However, I am currently facing two issues with the code. Here is a simplified version of my current implementation: loginWithGoogle(): void { //t ...

Using Jquery to iterate through a PHP array, calling an API to fetch data, and then storing the results

I am working with a PHP array called startups[] that contains 36000 startup names. My goal is to create a URL API endpoint using these names. Despite my efforts, I have been unsuccessful in utilizing jQuery to iterate through this PHP array and for each o ...

Disable button with Checkbox Javascript functionality

In my PHP code, I have an array of users that I pass to the view (in Laravel) and use a foreach loop to display all users in a table. Everything is working fine so far. However, I want to make a "send" button visible when a checkbox is clicked, instead of ...

Creating a border with tabs and a triangle using CSS

I'm having trouble getting my HTML/CSS tabs to look like the ones in the image. I've experimented with border-radius but haven't been able to achieve the desired result. Can anyone provide guidance on how to replicate these tabs using only ...

Database experiencing issue with data insertion functionality

I'm facing an issue while trying to use AJAX to insert data into a database. The strange thing is that everything seems to work fine except for the actual insertion of data into the database. Upon clicking the submit button, I receive the expected mes ...

Is there a notification system that sparkles like a precious Facebook gem

Is there a system similar to Facebook's request, message, and notification bubble system that can alert users on their profiles about new messages or notifications? I know Facebook is very advanced, but if anyone knows of something similar, please let ...