Jquery显示悬停效果

时间:2013-12-18 18:39:05

标签: jquery html css

<div class="hot_post">
<header>
<ul>
    <li><img src="<?php echo get_template_directory_uri(); ?>/images/hot_post.png" alt="hot post"></li>
    <li><h1>Hot Post</h1></li>
</ul> 
</header>
<div class="hot_post_list">
    <ul>
        <li>
            <div class="hot_post_single">
                <a href="" class="hot_post_thumbnail"><img src="http://lorempixel.com/83/83" alt="post title"></a>
                <img src="http://lorempixel.com/40/40" alt="autor_avatar" class="hot_post_avatar">
            </div>
            <div class="hot_post_title">This is post for wordrpess</div>
        </li>
        <li>
            <div class="hot_post_single">
                <a href="" class="hot_post_thumbnail"><img src="http://lorempixel.com/83/83" alt="post title"></a>
                <img src="http://lorempixel.com/40/40" alt="autor_avatar">
            </div>
            <div class="hot_post_title">This is post for wordrpess</div>
        </li>
        <li>
            <div class="hot_post_single">
                <a href="" class="hot_post_thumbnail"><img src="http://lorempixel.com/83/83" alt="post title"></a>
                <img src="http://lorempixel.com/40/40" alt="autor_avatar">
            </div>
            <div class="hot_post_title">This is post for wordrpess</div>
        </li>
    </ul>
</div>

我喜欢通过悬停“hot_post_thumbnail”来显示“hot_post_single&gt; img”和“hot_post_title”,默认显示为:hidden;

我应该使用哪些代码来执行此操作?我喜欢只显示一个“hot_post_single&gt; img”和“hot_post_thumbnail”这些是“hot_post_thumbnail”的相对。

1 个答案:

答案 0 :(得分:0)

这应该这样做: $(“。hot_post_thumbnail”)。hover(function(){

$(本).closest( “hot_post_title。”)显示(); $(这).closest( “IMG”)显示();

});