Special jquery buttons for showing on the control panel

I have an application creating a bunch of divs through a loop.

Each div has a class "product"

so it looks like

<div class="product">
       !.....stuff here ....!
       <div class="show_on_hover">...buttons here... </div>
</div>

therefore, one page contains about 12 of these sections.

I would like to hover over a specific one and show the specific div_ show_on_hover that was originally set to display: none.

$('.product').hover(function() {
    $(.show_on_hover).show();
    },
    function () {
        $(.show_on_hover).hide();
    }
);

This is what I have so far, but it will display ALL the .show_on_hovers pages on the page, so I'm wondering how to get only the specific one you made to show. This effect is displayed on youtube when you hover over any of the comments and some comment tools appear.

Thank!

+5
2

find div .show_on_hover .product. :

$('.product').hover(function() {
        $(this).find('.show_on_hover').show();
    },
    function () {
        $(this).find('.show_on_hover').hide();
    }
);
+11

Try   $ ('. show_on_hover', ).show()/. hide()

jQuery . div, .

+1

All Articles