Discovering the Magic of Bootstrap 2.2.1 Popovers

I've been attempting to implement Bootstrap popover element in my application.

Unfortunately, it doesn't seem to be working as expected. The popovers work fine when placed outside of a div with the overflow style property set.

Oddly enough, this code used to function properly in the previous version of Bootstrap.

You can view the issue I'm facing in this jsFiddle jsFiddle

What could possibly have gone wrong here??

Here's the relevant code for reference --

HTML -

   <body>
       <a href="#"  rel="popover" data-content="test" data-original-title="hello" style="position: absolute; top: 300px; left: 300px;">This works</a>
   <div id="cartridges">
       <div class="relative">
           <div id="listCartridges">
               <ul>
                   <li>
                       <a href="#"  rel="popover" data-content="test" data-original-title="hello">This doesnt work</a>
                   </li>
                   <li>
                       <a href="#"  rel="popover" data-content="test" data-original-title="hello">This doesnt work</a>
                   </li>
                   <li>
                       <a href="#"  rel="popover" data-content="test" data-original-title="hello">This doesnt work</a>
                   </li>
                   <li>
                       <a href="#"  rel="popover" data-content="test" data-original-title="hello">This doesnt work</a>
                   </li>
                   <li>
                       <a href="#"  rel="popover" data-content="test" data-original-title="hello">This doesnt work</a>
                   </li>
                   <li>
                       <a href="#"  rel="popover" data-content="test" data-original-title="hello">This doesnt work</a>
                   </li>
               </ul>
           </div>
       </div>
   </div>
                   </body>

CSS --

@import url('http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css');

body {
    background: #666;
}

#cartridges {
    position: fixed;
    overflow: visible !important;
    bottom: 0;
    left: 0
    width: 100%;
    border-top: 1px solid #AAA;
}

#cartridges > .relative {
    width: 100%;
    height: 100%;
}

#listCartridges {
    width: 100%;
    background: #222;
}

#listCartridges > ul {
    display: inline-block;
    overflow-x: scroll;
    overflow-y: hidden;
    max-width: 100%;
    white-space: nowrap;
}

#listCartridges > ul > li {
    display: inline-block;
    margin: 3px;
    padding: 3px;
    position: relative;
    vertical-align:middle;
    border: 1px solid #474747;
    overflow: none;
}

JS --

$("[rel=popover]").popover({
    animation: true,
    trigger: 'click',
    offset: 10,
    placement: 'top',
    delay: {
        show: 500,
        hide: 100
    }
}).click(function(e) {
    e.preventDefault();
});​

Answer №1

The issue arises due to the use of

overflow-x: scroll; overflow-y: hidden;
in your CSS.

A better solution would be:

#listCartridges > ul {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
}

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

How to use AJAX and jQuery .get() to fetch a particular element from an external document

Seeking a method using ajax and jQuery to load specific content from an external document based on a user's action of toggling a switch. The content to be loaded is determined by the name attribute of the toggle switch element. The process begins wit ...

Continuously update scrolling functionality

Could you please provide more information about the solution mentioned in the following question? I am facing a similar issue. jQuery’s css() lags when applied on scroll event Regarding solution #3 ->> To ensure continuous updates, it is suggeste ...

submit the JSON formatted data to the server

I am attempting to extract data from a form and transmit it to a remote server: Below is the code snippet: <html> <head> <script src="http://code.jquery.com/jquery-latest.min.js"></script> </head> ...

Turning spring form data into a JSON object via automation (with a mix of Spring, jQuery, AJAX, and JSON)

Recently, I've set up a spring form that utilizes ajax for submission. Here's an overview of my form... <form:form action="addToCart" method="POST" modelAttribute="cartProduct"> <form:input type="hidden" ...

Imitating Long Polling technique causing delays in rendering the entire webpage

Summary In my turn-based web app, each turn has a 60-second limit. If a user ends their turn before the 60 seconds are up, the next user automatically begins their turn. The mechanism behind this involves a PHP page where data generation is controlled by ...

Elevate Your Navbar's Hamburger Menu with Font Awesome SVG in React-Bootstrap!

Currently working with React-Bootstrap to create a Navbar. I have a desire to swap out the default hamburger menu icon provided by React-Bootstrap with a Font Awesome hamburger icon. Wondering what steps need to be taken in order to change the existing bu ...

Using JQuery to enable checkbox if another is selected

I have a single checkbox that reveals a hidden div when checked. Inside this div, there are two additional checkboxes. My goal is to disable the initial checkbox if either of these two checkboxes is checked. Here's the HTML code snippet: <p> ...

Click on the first jQuery element

I'm currently dealing with a menu that has multiple levels. My goal is to create a functionality where clicking on a first-level element will add the class .ubermenu-active to it, while also removing this class from any other first-level elements. $( ...

What is the method for adding two values?

I am still quite new to jQuery, so I apologize if this question is too basic. I have been struggling to find a solution to my issue of adding two values from a slider together. Below is the code that I attempted: <script> $(".slider2").slider({ ...

Ways to display notifications when the user is not actively browsing the website?

How can websites display notifications even when the user is not actively on the site? Take Facebook messenger, for instance. Even with the page closed, notifications still pop up. The same goes for Twitter, which also sends push notifications. I ...

Extracting user's clicked username to store in the database

I'm currently working on a script that allows users to mention others, but I've hit a roadblock. Each user can select another user by clicking on their name, which then adds the username to a designated div. Users can also input additional text ...

Step-by-step guide for creating the correct .css for Html.TextBoxFor

When it comes to my design preferences, I always aim for textboxes with a proper style. For instance: @Html.TextBoxFor(m => m.Number, new {disabled = "disabled", @class = "special-container"}) And in the .css file: .special-container { backgroun ...

Show results based on the selection of multiple checkboxes upon submission

When creating PHP pages to fetch data from databases, each checkbox is linked to a different page. I want to be able to check one or multiple checkboxes and then click the submit button to display the PHP pages that are linked to the checked checkboxes. Ho ...

Togglebox CSS is set to hide elements initially

I am having issues with Lightbox2 as it is not functioning properly when I try to click on the image. Upon inspecting the Developer Console in Chrome, I noticed that the overlay and image are being added to the DOM, but the display property is set to none ...

LoadingService is not provided in Angular 2

I've been searching for solutions to a similar issue on StackOverflow, but unfortunately, none of them are resolving my specific situation. I am currently using the latest version of Angular. Implementing Loader Component import {Component, Element ...

The outcome of the WCF Web Service shows an error of Unexpected Token Illegal - ParserError when using Chrome or IE9, but works fine

When I make an ajax request through jQuery, I am encountering a "SyntaxError: Unexpected token ILLEGAL" in Google Chrome and an "Unterminated string constant" error in IE9. Strangely enough, this function works perfectly fine in Firefox. The result output ...

Display the data submitted from a PHP form on an HTML webpage

In order to create an online quiz utilizing AJAX, I have developed a registration form where users can input their information. The PHP file will validate the details and return a username if they are correct. My goal now is to redirect users directly to ...

Exploring the CSS scale transformation alongside the Javascript offsetHeight attribute

After combining offsetHeight with scale transformation, I experienced a strange result. Below is my simple HTML code: <body> <div id="id01"> Some Text </div> <div id="id02" style="transform-origin: left top; transf ...

Troubleshooting CSS issues on Internet Explorer 8

I am experiencing issues only with Internet Explorer 8. As a newcomer, I am unsure why the link I added to my website is not working properly: Website When you click "Candidaturas" in IE8, you will notice that the text is broken and the styles are not di ...

Parse and style particular text within a DIV element

A unique text inside a div: Welcome to the world of coding. This is where creativity meets logic. Lines of code come together beautifully. Creating amazing projects is our goal. Mission: I aim to develop a script that will: Turn all instances of " ...