Guest User

Untitled

a guest
Jul 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. //remove inline-block gaps
  2. $('#menu').contents().filter(function() {
  3. return this.nodeType === 3;
  4. }).remove();
  5.  
  6. $(window).resize(function() {
  7. $('#menu li').show();
  8. var checkWidth = 0;
  9.  
  10. while (true) {
  11. checkWidth = 0;
  12. $('#menu li:visible').each(function() {
  13. checkWidth += $(this).outerWidth();
  14. });
  15. if ($(window).width() < checkWidth) {
  16. $('#menu li:not(:last-child):visible:last').hide();
  17. } else {
  18. break;
  19. }
  20. }
  21. }).resize();
Add Comment
Please, Sign In to add comment