I would like to programmatically add minimize and maximise buttons to web parts in Sharepoint 2013.

We have migrated from Lotus notes web editor which gave the option to do something similar out of the box. with:

Arrow heads that collapsed and expanded sections when the user clicked. I appreciate that there is nothing out of the box that will replicate this so it looks like code is going to be the only option. Can anyone advise a method for this please?


If you are open to editing page in SharePoint Designer, then you can use following logic using JavaScript.

  1. Place a div tag around the web part

    <img src="MaximizeImage" id="webpartitleMaximize" onclick="Maximize()"/>
    <img src="MinimizeImage" id="webpartitleMinimize" onclick="Minimize()"/>
    <div id="webparttitle">            
        <!-- Actual Webpart goes here -->
  2. Add following script

    <script type="text/javascript">
        function Maximize(){
            document.getElementById("webparttitle").style.display = "block";
        function Minimize(){
            document.getElementById("webparttitle").style.display = "none";
| improve this answer | |
  • many thanks - I will give it a go. I achieved the same result by using rules and collapsible sections on the actual InfoPath form – Dave Edmonds May 22 '15 at 12:27

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.