Menu Overflow
How do I make an menu overflow?
What is a menu overflow? How do you make a menu overflow? This script and codes were developed by Anthony Adamski on 25 August 2022, Thursday.
Menu Overflow - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Menu Overflow</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <ul class="firstList"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> <li>Item 6</li>
</ul>
<ul class="secondList">
</ul>
<h1></h1>
<h2></h2> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Menu Overflow - Script Codes CSS Codes
ul { white-space: nowrap; width: 100%; overflow: auto;
}
ul li { display: inline-block; width: 200px; list-style: none; background: blue; margin: 5px;
}
.firstList { background: red;
}
.secondList { background: green;
}
Menu Overflow - Script Codes JS Codes
var resizeId;
$(window).on('resize', function() { clearTimeout(resizeId); resizeId = setTimeout(doneResizing, 500);
});
function doneResizing() { navWidth = $('ul').width(); navItem = $('.firstList > li'); hiddenItem = $('.secondList > li'); navItem.each(function(index) { navItemOffset = $(this).offset().left + $(this).width(); if (navWidth <= navItemOffset) { $(this).appendTo('.secondList'); } }); hiddenItem.each(function(index) { lastItemOffset = navItem.last().offset().left + $(this).width(); console.log(lastItemOffset); console.log(navWidth); if (navWidth >= (lastItemOffset + 200)) { console.log('Added Item'); $('.secondList > li:last').appendTo('.firstList'); } });
}
Developer | Anthony Adamski |
Username | anthonyadamski |
Uploaded | August 25, 2022 |
Rating | 3 |
Size | 2,280 Kb |
Views | 42,504 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Full Viewport Background Scroll | 1,859 Kb |
Simple CSS3 Slider | 2,839 Kb |
Video Test | 1,835 Kb |
Live resume concept | 4,567 Kb |
Responsive Email Template | 3,373 Kb |
Cool Page Split Effect | 6,128 Kb |
Single page concept | 5,640 Kb |
Live CSS Blur | 2,648 Kb |
Work In Progress | 225,703 Kb |
Jquery Snippets | 2,221 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Twitch API | Coderpilot | 3,412 Kb |
A Pen by Gregory Potdevin | GregoryPotdevin | 1,713 Kb |
Sign Up Form | Sicontis | 5,272 Kb |
Animate a paper plane along an SVG path, looking ahead | PotatoDie | 3,734 Kb |
A Pen by Dalton Liu | Liudalton | 12,437 Kb |
Custom checkbox example | Capelo | 3,495 Kb |
404 Page | Saransh | 2,666 Kb |
SnappySnippet Test | Elmsoftware | 8,385 Kb |
A Pen by Huan Nghiem | Nightshade | 10,646 Kb |
Spin | Elalemanyo | 8,262 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!