Skip to content

Instantly share code, notes, and snippets.

@Preciousomonze
Last active January 26, 2023 21:41
Show Gist options
  • Save Preciousomonze/e48a77ff26370203a5d28e43669b1fb4 to your computer and use it in GitHub Desktop.
Save Preciousomonze/e48a77ff26370203a5d28e43669b1fb4 to your computer and use it in GitHub Desktop.
Basic js to help in a “readmore” scenario for a friend.
jQuery( function($) {
$( document ).ready( function() {
function showFullDesc(event, c) {
event.preventDefault();
// Get the clicked element section cover.
$_ParentEL = $(this).closest( '.section_cover' );
// Now trigger the necessary for the clicked item.
$_ParentEL.find( '.short_d' ).css( 'display', 'none' );
$_ParentEL.find( '.full_d' ).css( 'display', 'block' );
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment