Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //remove inline-block gaps
- $('#menu').contents().filter(function() {
- return this.nodeType === 3;
- }).remove();
- $(window).resize(function() {
- $('#menu li').show();
- var checkWidth = 0;
- while (true) {
- checkWidth = 0;
- $('#menu li:visible').each(function() {
- checkWidth += $(this).outerWidth();
- });
- if ($(window).width() < checkWidth) {
- $('#menu li:not(:last-child):visible:last').hide();
- } else {
- break;
- }
- }
- }).resize();
Add Comment
Please, Sign In to add comment