The horizontal dropdown sub-menu fails to display when the x-axis overflow is set to hide

Looking to create a bootstrap dropdown sub-menu button that is scrollable? I came across something similar through a quick search. To make this button scrollable, I added the following class:

<ul class="dropdown-menu scrollable-dropdown">
  <li></li>
</ul>

.scrollable-dropdown {
    height: auto;
    max-height: 150px;
    overflow-x: hidden;
    width: 200px;
}

However, after adding this class, the sub-menu is not being displayed.

Check out the fiddle with the issue here.

Answer №1

Implement overflow: auto;

Although it functions properly, simply using overflow: auto; may not enhance the appearance of the menu significantly. Consider positioning the Submenu below the main menu option it originates from, and utilize a different CSS to clearly indicate that it is a submenu.

Combine this with overflow: auto;. Include position: relative and eliminate the top: 0;

.dropdown-menu .sub-menu {
    position: relative;
    display:none;
    margin-top: -1px;
    border-top-left-radius:0;
    border-bottom-left-radius:0;
    border-left-color:#fff;
    box-shadow:none;
}

Here is the updated fiddle link

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

Prevent the Esc key from closing panel in jQuery Mobile

As per the jQuery Mobile documentation: "If you click the link that opened the panel, swipe left or right, or tap the Esc key, the panel will close. By default, panels can also be closed by clicking outside of the panel onto the page contents." Visit t ...

Unable to properly link CSS files

One of the students I am teaching has written the following code snippet: <title> Portfolio </title> <link rel="stylesheet" type="text/css" src="portfolio1style.css"> </head> The portfolio1style.css file is locate ...

Allow users to select only certain dates within the Bootstrap datepicker

I have integrated a bootstrap datepicker plugin from https://github.com/uxsolutions/bootstrap-datepicker on my website, and I am looking for a way to enable and disable certain dates based on an array of specific days. How do I achieve this functionality i ...

The issue of Firefox background image flickering is persistent when multiple instances are open and the background-size

I am facing an issue with background images on my webpage. I have two elements that share a background image and are contained within 3 column width containers using Bootstrap. In the second element, I have set the background to be 90% in width, making it ...

I am having trouble keeping my containers from overlapping

I have used bootstrap to create the following design: https://i.sstatic.net/1yqKI.jpg Here is the code for the design shown above: <div class="jumbotron cta-header"> <div class="container cta-intro-box"> <h1 class="cta-heading ...

Jquery Ajax Finger gallery

After numerous days of scouring Google without success, I find myself at a loss. Uncertain if Stack Overflow is the appropriate platform for my inquiry, but here goes... Does anyone have recommendations for quality jQuery Gallery plugins that support ima ...

What is the best strategy for queuing AJAX requests when they depend on input from previous requests for efficiency?

I am currently developing an application within the SharePoint platform that requires making three distinct AJAX requests: Firstly, a call to the Search API is made to retrieve all individuals with a specific job title associated with the account ID (sea ...

Interactive website that transitions to a fresh page as we scroll further

As a beginner in web design, I've noticed a trend of companies using websites that automatically transition to the next page when scrolling down. An example of this is . What is this type of template called and are there any open source designs availa ...

Discovering which particular input element the user entered text into

I am facing a challenge with a page that contains several text inputs, and I need to identify which specific text input the user is currently typing in. All text inputs have identical code for display, and unfortunately, I am unable to alter the HTML direc ...

New Release: Bootstrap4 beta introduces improved table features and d-inline-block styling

I need to arrange multiple tables side by side and allow horizontal scrolling overflow if they don't fit on the page. Here is a sample in jsfiddle: https://jsfiddle.net/c949Lspy/10/ Using Bootstrap: <div style="white-space: nowrap;"> <ta ...

Leveraging the sibling combinator for altering the class of a sibling SVG element with the assistance of Material

I have created an SVG picture that I am trying to animate. Behind the elements I want to animate on mouse hover, I have added transparent rectangles. The hover effect works well on these elements as the cursor changes to pointer. However, when I attempt t ...

Pass an array containing an HTML string to the $.post method in jQuery

I have a problem with displaying HTML content fetched from a PHP script using the jQuery $.post method: $.post('{$site_url}tests/tests/content', params, function (data) { $('#some-div1').html(data[1]); $('#some-div2').htm ...

Using foreach loop in PHP to create checkboxes within a table

I am facing a simple issue with a table generated using PHP foreach in codeigniter. One column inside the table contains two checkboxes - one for true and one for false. When the table is created, it displays names, information, and these two checkboxes. ...

Does renaming a page to index.html have any impact?

After restarting my laptop, everything was back to normal. Thank you for the help and replies. The issue I'm facing is with two identical pages that have the same code. The only difference between them is the file names - index and index2. However, f ...

Firefox compatibility issue: Bootstrap modal button not functioning properly when wrapping other HTML elements

Hey everyone, I've come up with some awesome image hover effects that you can use. I've implemented bootstrap modals so that when you click on 'show code', a pop-up will display with the HTML and CSS codes for easy copy-pasting. However ...

Experiencing Difficulty Personalizing Bootstrap Navigation Bar

I am attempting to add a circular border to a Font Awesome icon and this is the result: https://i.sstatic.net/28NFV.png This code snippet is for the page header. My goal is to enlarge the buttons when the screen size changes. .circle-icon { width: 80px; ...

Slide your finger upwards to shut down the mobile navbar in bootstrap

Hey there, I'm currently developing a website using Bootstrap framework v3.3.4. I have a mobile navbar that opens when I click a toggle button, but I would like it to slide up to close the navigation instead. Here is an image showing the issue Do y ...

Struggling with the youtube API on slow network connection

Within my web project, I have integrated a YouTube player within a Bootstrap carousel slide that is part of a larger template (the code snippet below does not include the full html for the carousel): <script type="text/html> <div class="video-con ...

step-by-step guide to replacing an item in an array using javascript

I am working with some HTML codes : <p class="Chords">[A] [B] [C]</p> <p> Some Text Goes Here </p> <p class="Chords">[D] [E] [F]</p> <p> Some Text Goes Here </p> <p class="Chords">[G] ...

Hide the scrollbars on the sidebar

I'm attempting to recreate a sleek scrollbar that caught my eye on the website . To achieve this, I need to have a screen larger than 955px in order to display the sidebar. However, when my sidebar overflows in the y direction, it causes an additional ...