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 grouping of those links. See in fig
2. Now enable the all group as an Accordion I simply added Script Editor Web part to this page. See in fig
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
/* Slide up all link items and hide them */
/* Binding a click event handler to the links: */
/* 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 */
/* Preventing the default event (which would be to navigate the browser to the link's address) */
4. Whole code added here. See in fig
5. Now you able to see your web part work as an Accordion. See in figs and compare with first fig you able to see the changes.