Today I created a simple accordion script to collapse a lengthy bit of inline text on a page. The challenge was trying to collapse not only simple items, but also sub-items on the page. While the process of creating the accordion script was relatively straightforward (as seen below), the majority of time went into redesigning the paragraphed text to be wrapped in unordered list items!
I had to also place within this code the ability to reconfigure the height of the newly expanded page (as there was a footer underneath). All it took was the ability to get the
$("ul#accordion").outerHeight() and reapply this new height to its parent container and then have jQuery modify the height of the parent container.
For the sake of brevity I’ve only included the core elements needed to see the simple multi-level accordion in action.
To see this as a working example check it out on jsfiddle.
In a previous post I explored how to ignore blank cells when using the QUERY function in Google Sheets, which had its own distinct way of removing blank cells from the data capture. But how do...
A recent project hit a roadblock when I changed some code depending on the N/search module and refactored it to use N/query module. While I had some initial hassles with accepting the Beta nature of...