开发者

jQuery Selector: show onclick

开发者 https://www.devze.com 2023-01-06 21:19 出处:网络
I\'m having a bit of trouble getting a certain div to show onclick. Any takers? HTML <div style=\"float:left;width:40px;\">

I'm having a bit of trouble getting a certain div to show onclick. Any takers?

HTML

<div style="float:left;width:40px;">
<span class="productControl" style="position:relative;">
    <div class="productMenuHolder" style="display:none;">
    <ul class="productMenuList">
        <开发者_高级运维;li class="productMenuItem">Add to Collection</li>
        <li class="productMenuItem">Share</li>
    </ul>
    </div>
</span>
</div>

jQuery

$("span.productControl").click(function(){
    $(this).next().show();
});

The productMenuHolder doesn't seem to show up!


$(this).find('.productMenuHolder').show()

I suggest you look a bit closer at the markup.

0

精彩评论

暂无评论...
验证码 换一张
取 消