Some time we will have a very long dropdown menu items in Website sticky menu and we cannot access most the menu on the dropdown. Yes, you must face this kind of issue once in your web development era. You might be skipped to different menu option in that case.

Now You are worrying even if it is a very very long menu. I have solution for you to scroll the menu even the menu is sticky.

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            
    $"origHeight", $container.height());

    // so it can retain it's rollover color all the while the dropdown is open

    // make sure dropdown appears directly below parent list item    
            paddingTop: $"origHeight")

    // don't do any animation if list shorter than max
    if (multiplier > 1) {
                height: maxHeight,
                overflow: "hidden"
            .mousemove(function(e) {
                var offset = $container.offset();
                var relativeY = ((e.pageY - * multiplier) - ($"origHeight") * multiplier);
                if (relativeY > $"origHeight")) {
                    $list.css("top", -relativeY + $"origHeight"));

}, function() {

    var $el = $(this);

    // put things back to normal
        .css({ top: 0 })


// Add down arrow only to menu items with submenus
$(".dropdown > li:has('ul')").each(function() {

Here is the demo Link

Leave a Reply

Your email address will not be published. Required fields are marked *