Use Summary Link Web Part as an Accordion in SharePoint Online 2013


In this post, we will discuss how to use Summary Link Web Part as an Accordion in SharePoint 2013 Online.

Also, you can check out:
1. First I added the Summary link web part in my page and added the grouping of those links. See in fig
Use Summary Link Web Part as an Accordion in SharePoint Online 2013
Use Summary Link Web Part as an Accordion in SharePoint Online 2013
2. Now enable the all group as an Accordion I simply added Script Editor Web part to this page. See in fig
Use Summary Link Web Part as an Accordion in SharePoint Online 2016
Use Summary Link Web Part as an Accordion in SharePoint Online 2016
3. Now I am going to making this web part into a fully functional accordion for this I added a simple Jquery script the performs hide all hyperlinks in this groups and when a user clicks a group header, hide all sections that is not the current header and expand current selected link selection. So add the following code
<script src=”//code.jquery.com/jquery-1.11.0.min.js”></script>
<script src=”//code.jquery.com/jquery-migrate-1.2.1.min.js”></script>
<script type=”text/javascript”>
$(document).ready(function()
{
       /* Slide up all link items and hide them */
       $(“.dfwp-list”).slideUp(“fast”);
               /* Binding a click event handler to the links: */
               $(‘.groupheader’).click(function(e)
               {
            /* Finding the drop down list that corresponds to the current section: */
            var dropDown = $(this).next(“.dfwp-list”);
           /* Closing all other drop down sections, except the current one */
           $(‘.dfwp-list’).not(dropDown).slideUp(‘slow’);
           dropDown.slideToggle(‘slow’);
            /* Preventing the default event (which would be to navigate the browser to the link’s address) */
            e.preventDefault();
        })
})
 </script>
4. Whole code added here. See in fig
Use Summary Link Web Part as an Accordion in SharePoint Online 2019
Use Summary Link Web Part as an Accordion in SharePoint Online 2019
5. Now you able to see your web part work as an Accordion. See in figs and compare with the first fig you able to see the changes.
Use Summary Link Web Part as an Accordion in SharePoint Online 2010
Use Summary Link Web Part as an Accordion in SharePoint Online 2010

You May Also like the Following SharePoint Online Tutorials:

About Navneet Singh

I am Navneet Singh, Working at C3it software solutions pvt. ltd. in Pune. My core skills are SharePoint 2013, Office 365, SharePoint 2010, SharePoint Designer, SharePoint Designer Workflow, Nintex Workflow, Infopath, Webpart, CSOM/SSOM, Power-shell, C#, ASP.NET and SQL Server.

View all posts by Navneet Singh →

Leave a Reply