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 ).on( 'click', '.ola-section-readmore', function( event ) {
event.preventDefault();
console.log("workssss");
// Get the clicked element section cover.
$_ParentEl = $(this).closest( '.ola-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