show hide image script after 4 seconds [closed]

If you had for example,

<img src="https://wordpress.stackexchange.com/questions/228932/rdp_banner.jpg" id="logoimage">

You could just do…

add_action('init','checkvisitcookie');
function checkvisitcookie() {
    if (isset($_COOKIE['firsttimevisit'])) {return;}
    setCookie('firsttimevisit','1',100*365*24*60*60);  
    add_action('wp_footer','fadelogoout');
} 

function fadelogoout() {
    echo "<script>
    jQuery(document).ready(function() {
        setTimeout(function() {
            jQuery('#logoimage').fadeOut();
        }, 5000);
    });
    </script>";
}

Just to make it almost relevant to WordPress 😉

Leave a Comment

tech