2

One of the Projects I am working on, I have a requirement to split 9 top sharepoint navigation links into two rows. I have a master page in action. I would need to display 5 of the navigation links in the first row and then 4 in the second row. Is this possible, can someone help me with the CSs , JS/JQ code? Thanks in advance.

2

You could do it with some javascript - add the <br/> tag after the 5th menu item. Something like this should work:

<script type="text/javascript">
$(document).ready(function(){
    $("[id ^=zz][id $=_RootAspMenu] li li").children(":eq(4)").parent().after("<br/>")
}); 
</script>
  • Thanks Damjan, could you explain what zz and _RootAspMenu indicate in terms of id? – mdevm Jun 7 '18 at 20:09
  • The id of the ul tag that holds the menu is not fixed, but it always starts with zz and ends with _RootAspMenu (it is usually zz1_RootAspMenu or zz12_RootAspMenu), so with this selector we solve that problem (we find the tag whose id starts with zz and ends with _RootAspMenu). – Damjan Tomic Jun 7 '18 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.