Foros‎ > ‎Sharepoint‎ > ‎

Focus on content with fixed navigation

publicado a la‎(s)‎ 21 may. 2014 13:41 por Ignacio Gonzalez   [ actualizado el 21 may. 2014 15:59 ]
Find this script on your master page:

<script type="text/javascript">//<![CDATA[
        var g_pageLoadAnimationParams = { elementSlideIn : "sideNavBox", elementSlideInPhase2 : "contentBox" };
        //]]>
        </script>



and replace with:



<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
            <script type="text/javascript">//<![CDATA[
        var g_pageLoadAnimationParams = { elementSlideIn : "sideNavBox", elementSlideInPhase2 : "contentBox" };
    
        
function ManageScroll()
  {
  
  if ($("#s4-workspace").length && $("#ccNav").length && $("#MenuGlobal").length)
  {
  if($("#ccNav").is(':hidden'))
  {
$("#s4-workspace").css('height', ($("#s4-workspace").height() - $("#MenuGlobal").height()) + 'px');
}
else
{
$("#s4-workspace").css('height', ($("#s4-workspace").height() + $("#MenuGlobal").height()) + 'px'); 
}
}
  }


//Replace the function with a new function
function CustomSetFullScreenMode(fEnableFullScreenMode) {
   

if ($("#s4-workspace").length && $("#s4-titlerow").length)
  {      
  if (fEnableFullScreenMode) {
  /*$('#s4-titlerow').css({"visibility":"hidden"});
      $('#s4-titlerow').css({"display":"none"});*/
     
      $('body').addClass( "ms-fullscreenmode" );            
      $("#s4-workspace").css('height', ($("#s4-workspace").height() + $("#s4-titlerow").height()) + 'px');
      $('#exitfullscreenmode').css({"display":"block"});
      $('#fullscreenmode').css({"display":"none"});
       
        }
  else {
    /*$('#s4-titlerow').css({"visibility":"visible"});
      $('#s4-titlerow').css({"display":"block"});*/
     
      $('body').removeClass( "ms-fullscreenmode" );
      $("#s4-workspace").css('height', ($("#s4-workspace").height() - $("#s4-titlerow").height()) + 'px');
      $('#exitfullscreenmode').css({"display":"none"});
      $('#fullscreenmode').css({"display":"block"});

  }
}
}
        
        //]]>
        </script>

after that, add the following JS at the bottom of the master page, before </body> tag. This JS replace the SetFullScreenMode function with the custom function.


   <script type="text/javascript">
var tabRight = document.getElementById('fullscreenmodebox');
tabRight.innerHTML = tabRight.innerHTML.replace(/\b(SetFullScreenMode)\b/g, 'CustomSetFullScreenMode');
                                CustomSetFullScreenMode(false);
</script>








 
Comments