When user click on MoreDiv HiddenDiv will be show and when click again or clicked on any where of page hiddenDiv div
must be hidden More
this is my css
.hiddenDiv {
margin-left:505px;
margin-top:25px;
display:none;
z-index:9876567890;
position:absolute;
width:100px;
border:1px solid #CCC;
}
.hiddenDiv ul {
list-style:none;
list-style-type:none;
padding:0;
margin:0;
}
.hiddenDiv ul li {
padding:2px;
cursor:pointer;
} .hiddenDiv ul li:hover {
background-color:#4681C5;
}
This is my div
<div class="hiddenDiv">
<ul>
<li>Add favorites</li>
<li>Give a Gift</li>
<li>Block</li>
</ul>
</div>
This is my jquery code
$(document).ready(function() {
$('div.moreDiv').click(function() {
$(".hiddenDiv").css('display', 'block');
});
});
Use the
showmethodThe below script will show when you click on the more link and hide it if you click anywhere in the window.
Working sample : http://jsfiddle.net/R7VRq/31/