Skip to content

Instantly share code, notes, and snippets.

@wasim117
Created July 21, 2012 19:17
Show Gist options
  • Save wasim117/3156880 to your computer and use it in GitHub Desktop.
Save wasim117/3156880 to your computer and use it in GitHub Desktop.
Adding zindex to breadcrumbs dynamically
jQuery(document).ready(function(){
var breads = jQuery("ul.breadcrumbs li").length; // count the number of list items
jQuery("ul.breadcrumbs li").each(function(){
jQuery(this).css("z-index", breads); // add z-index starting from largest first
breads = breads -1; // decrease z-index to smallest
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment