[Solved] How to create a button to every list item which opens a menu over it?


I’ve changed your structure little bit and made the ‘dots’ image as a button of the menu with jquery

HTML:

<img src="https://stackoverflow.com/questions/27638476/3dots.png" class="dots"/>
<div class="dots_menu">
    <a href="#">link 1</a>  
    <a href="#">link 2</a>  
</div>

CSS:

.app
{
    position: relative;
}

.dots
{
    float: right;   
}

.dots_menu
{
    display: none;
    width: 202px;
    position: absolute;
    top: 35px;
    right: 0;
    z-index: 1;
    background: rgb(238, 238, 238);
    -webkit-box-shadow: 0px 4px 15px #000;
    -moz-box-shadow: 0px 4px 15px #000;
    box-shadow: 0px 4px 15px #000;
}

.dots_menu.show
{
    display: block;
}

.dots_menu a
{
    display: block;
    text-decoration: none;
    color: #000;
    padding: 10px;
}

JQuery:

$(document).ready(function(){
    $('.dots').click(function(){
        $('.dots_menu').removeClass('show');
        $(this).next().addClass('show');
    });        
});

example: http://jsfiddle.net/e0byofe2/3/

is that what you are looking for?

2

solved How to create a button to every list item which opens a menu over it?