jElementExpander hide dom elements after hitting a desired one
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A simple jQuery plugin to add "Read More" / "Read Less" style links before a certain element is found. The common scenario this plugin is for is when you want to add hide content when a different tag (say H2 or UL) is found.



Is turned into:

<a>Read More...</a>


The following options, shown here with their default values, are currently available:

// elements to find, and add the read more/less link BEFORE.
// The first occurance gets the read more/less link.
// If the first element matches, it won't count that one but the next.
elementsToBreatAt : ['H2', 'UL'],

// Text for when the content is hidden
hiddenLabel: 'Read more...',

// Text for when the content is visible
showLabel: 'Read less...'


A demo is the index.html file with common scenarios described above.


This plugin is free of charge and licensed under the [MIT][2] license. As a courtesy to GPL-licensed projects that may wish to include the plugin, it is also licensed under the [GPL][3] license.

Feature Requests

This plugin was designed for a particular scenario I have with a client's website. I don't intend to implement more features, but if they are quick you can always just ask.


Author: Phil Jones

Twitter: @philjones88