Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7610115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:20:29+00:00 2026-05-31T01:20:29+00:00

I am trying to add a scrollbar to a dropdown menu options so when

  • 0

I am trying to add a scrollbar to a dropdown menu options so when user clicks the menu it won’t show all the options all the way till end. I tried

<select name='menu'>
  <option value='1'>first item</option>
  <option value='2'>second item</option>
  <option value='3'>third item</option>
  <option value='4'>fourth item</option>
  <option value='5'>fifth item</option>
  <option>........
  <option>........
  //I have many options.....
</select>

I try this css but it only works on the menu itself, not options.

select {
height:50px;
overflow-y: scroll;
}

Any thoughts? Thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:20:30+00:00Added an answer on May 31, 2026 at 1:20 am

    This is also I nice way of handeling it 🙂

    http://css-tricks.com/long-dropdowns-solution/

    From the link above:

    var maxHeight = 400; $(function(){
    
    $(".dropdown > li").hover(function() {
    
         var $container = $(this),
             $list = $container.find("ul"),
             $anchor = $container.find("a"),
             height = $list.height() * 1.1,       // make sure there is enough room at the bottom
             multiplier = height / maxHeight;     // needs to move faster if list is taller
    
        // need to save height here so it can revert on mouseout            
        $container.data("origHeight", $container.height());
    
        // so it can retain it's rollover color all the while the dropdown is open
        $anchor.addClass("hover");
    
        // make sure dropdown appears directly below parent list item    
        $list
            .show()
            .css({
                paddingTop: $container.data("origHeight")
            });
    
        // don't do any animation if list shorter than max
        if (multiplier > 1) {
            $container
                .css({
                    height: maxHeight,
                    overflow: "hidden"
                })
                .mousemove(function(e) {
                    var offset = $container.offset();
                    var relativeY = ((e.pageY - offset.top) * multiplier) - ($container.data("origHeight") * multiplier);
                    if (relativeY > $container.data("origHeight")) {
                        $list.css("top", -relativeY + $container.data("origHeight"));
                    };
                });
        }
    
    }, function() {
    
        var $el = $(this);
    
        // put things back to normal
        $el
            .height($(this).data("origHeight"))
            .find("ul")
            .css({ top: 0 })
            .hide()
            .end()
            .find("a")
            .removeClass("hover");
    
    });
    
    // Add down arrow only to menu items with submenus
    $(".dropdown > li:has('ul')").each(function() {
        $(this).find("a:first").append("<img src='images/down-arrow.png' />");
    });
    

    });

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find a way to add a cross-browser compatible scrollbar to
trying to add an ExpiresDefault ExpiresByType to content on my website so that way
Trying to add email notification to my app in the cleanest way possible. When
I'm using wxPython 2.8 and i'm trying to add scrollbar capabilities on the right
I'm trying to add a scrollbar to a JList (which uses a custom data
I am trying to add a scrollbar, or prefrably a slider, that zooms in
learning html/css here. I'm trying to add a border-bottom to my .menu ul li
I am trying to add vertical and horizontal scrollbars to my UserControl with the
I'm trying add a tab to my web page that looks like this: Using
Trying to add an onclick handler to my tabs, and can't seem to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.