鼠标移到元素上面和移开改变元素属性的JavaScript代码

<article id="post-<?php the_ID(); ?>" <?php post_class('post-item'); ?> onmouseover="this.children[1].style.display = 'block'"
         onmouseout="this.children[1].style.display = 'none'">

    <a href="<?php the_permalink(); ?>">
        <?php if (has_post_thumbnail()) {
            the_post_thumbnail('preview');
        } else {
            $thumb = catch_that_image();
            echo '<img src="' . $thumb . '">';
        } ?>
    </a>
    <header class="entry-header" style="display: none">
        <a href="<?php the_permalink(); ?>">
            <?php the_title('<h1 class="entry-title" >', '</h1>'); ?>
        </a>

        <?php echo esc_html(millo_post_category());
        echo esc_html(do_action('pro-portfolio-type'));

        ?>
    </header><!-- .entry-header -->
</article>
Posted in code