Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1095090

    Hello,
    i have added a custom script to the funtions.php and this works well for me but it only works on the Main Page and no where else.
    I dont know if this error is caused by enfold or wrong code?

    add_action('wp_footer', 'hide_on_sent');
    
    function hide_on_sent(){
    ?>
    <script type="text/javascript">
    document.addEventListener( 'wpcf7mailsent', function( event ) {
        setTimeout(function() {
      $('#hideonsent').hide(); }, 0);
    	setTimeout(function() {
      $('#hideonsent').show(); }, 5000);
    	setTimeout(function() {
      $('.wpcf7-mail-sent-ok').hide(); }, 5000);
    }, false );
    </script>
    <?php
    }

    Hope there is somebody who can help me cause i try since hours with no effect.

    Thanks,
    Banshee350

    #1095867

    Hey Banshee350,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #1096102

    Off course, here the login.

    #1096949

    Hi Banshee350,

    The event listener has to be added to the class, id or tag and your code does not use that. Please adjust the script accordingly.

    Best regards,
    Victoria

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.