I would like to add a button to a webpart we have already created that increases usability for our document libraries. I would like this button, when clicked to toggle the standard ribbon that is shown in document libraries. I realize this functionality already exists inherantly in sharepoint but it is not very obvious to our users who aren't regulars.

Ideally I just want something that I can throw in a jquery click funciton. I have tried using some code from other examples out there but no success. Can someone tell me how to trigger the out of the box sharepoint ribbon hide and show events??

1 Answer 1


The following should work from a click event:

$("#s4-ribbonrow").hide().parent().find("#s4-workspace").css({ "height":"auto", "overflow-y":"auto" });


<a href="javascript:" onclick='$("#s4-ribbonrow").hide().parent().find("#s4-workspace").css({ "height":"auto", "overflow-y":"auto" });'>Full Screen</a>


  • I should mention. This will only hide it. Making it visible again is tricky, specially if the user does a browser window resize after the ribbon was closed. My suggestion for bringing the ribbon back is to refresh the page.
    – Paul T.
    Nov 20, 2013 at 2:03
  • Unfortunately I was more looking for the show ribbon. Currently our ribbon is hidden by default so a refresh wouldn't be very helpful.
    – BlueBird
    Nov 21, 2013 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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