Tuesday, June 19, 2012

SharePoint 2010 - Show/Hide Left Navigation


Issue:   Show/Hide Left Navigation-SharePoint 2010


Solution:

Place below code before the closing tag </head> in your customized v4.master

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {
// do stuff when DOM is ready

LeftNavCollapsible();
}); 
var flg = 0;
function LeftNavCollapsible()
{
$("#s4-leftpanel-content ul.root>li.static>a").toggle(
 function () {
$(">ul", $(this).parent()).show("fast");
 },
 function () {
$(">ul", $(this).parent()).hide("fast");
 }
);
$("#s4-leftpanel-content li.static>ul.static").css("display","none");
}
</script>

No comments:

Post a Comment