Archived topic
Making element disappear on click
2 replies · Started by chris on June 22, 2021
Hi i have made a popup on the shop page with an element that moves up our of view, but i wish to make it actually disappear and for the shop items to move up Asif the element isnt there, as right now it just moves up and the shop items stay where they were because i guess the element is still actually there.
Using element > Hook > and a script i found in one of David's replies to another user.
<script>
jQuery( document ).ready( function( $ ) {
$( '.top-close-button' ).on( 'click', function( e ) {
e.preventDefault();
$( '.announcer' ).css( 'transform', 'translate(0%, -300%)' );
} );
} );
</script>
Or is there a way in generatepress it's self to remove an element on button click?
Hi Chris,
Custom scripts are generally outside of our scope of support, I'm afraid.
But to help you out:
Can you specify which element/s is/are supposed to be removed on button click? And what button is the trigger?
Screenshots would give us a good idea.
Let us know.