LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code


	
	
	

Priority+ Navigation

The Priority+ pattern was coined by Michael Scharnagl (@justmarkup) to describe navigation that exposes what’s deemed to be the most important navigation elements and tucks away less important items behind a “more” link. The less important items are revealed when the user clicks the “more” link.

Pros

  • Relatively simple to implement – The logic required to execute this technique isn’t terribly complicated. It’s just a basic show/hide toggle to reveal the hidden navigation items.
  • (hopefully) exposes the most accessed features – it’s hopefully revealing the three or four things the majority of users frequently access anyways.

Cons

  • Hides potentially important nav items – what you may deem most important may not be what’s important to your users. Burying nav items means having to make some assumptions, and while it hopefully works out for most users, it might also piss some people off.
  • Doesn’t work well with multi-level navigation – The priority+ pattern seems good for navs that have a lot of items at the same hierarchy level, but unfortunately it doesn’t seem to solve the sub-nav dilemma.

Resources

In the Wild

CSS
.menu li {
  display: inline-block;
  margin: 0 0.25em;
}
.menu li.hidden {
  display: none;
}
.menu li a {
  display: block;
  padding: 1em 0.5em;
}

@media screen and (min-width: 48.25em) {
  body:after {
        content: 'large';
        display: none;
    }
    #toggler {
      display: none;
    }
}
JS
/*
  	
		Warning: extremely sloppy code.
		
		*/
		$(document).ready(function() {
			var $menu = $('#menu'),
				$menuList = $menu.find('ul'),
		  		bp = window.getComputedStyle(document.body,':after').getPropertyValue('content'),
		  		$toggler;
		  	
		  	
		  	if(!$('#toggler').length) {
				$('
  • More+
  • ').appendTo($menuList); $toggler = $('#toggler'); } function checkSize() { if(bp=='large') { showNav(); } else { hideNav(); $toggler.text('More+'); } } function showNav() { $menu.find('li:not(.priority)').removeClass('hidden'); } function hideNav() { $menu.find('li:not(.priority)').addClass('hidden'); } function changeNavLabel() { $toggler.toggleClass('active'); if($toggler.hasClass('active')) { $toggler.text('Less-'); showNav(); } else { $toggler.text('More+'); hideNav(); } } $menu.on("click", "#toggler", function(e){ //Clicking toggle e.preventDefault(); changeNavLabel(); }); $(window).resize(function() { //On Window resize bp = window.getComputedStyle(document.body,':after').getPropertyValue('content'); checkSize(); togglerVisibility(); }); checkSize(); togglerVisibility(); });

    Description

    The Priority+ pattern was coined by Michael Scharnagl (@justmarkup) to describe navigation that exposes what’s deemed to be the most important navigation elements and tucks away less important items behind a “more” link. The less important items are revealed when the user clicks the “more” link.
    Term
    Mon, 11/27/2017 - 21:24

    Related Codes

    Pen ID
    Pen ID
    Pen ID
    Square Adv