I have two div
with #bodyProduct
, and within each has div
with a div
with a #btn-extende
.
A% of parent product has a div
fixed with overflow , hiding the rest of the contents of it, and the height
button serves exactly to extend this extende
to% auto_%, to show all content, but the problem is that when I put the system to work by clicking on the first div
, it works, but when I click on the second height
, it instead of extending the btn-extende
to which it is inserted, it extends the first btn
with div
.
How do I affect only the% of parent% of the div
that is tight?
<div id="bodyProduct">
<div id="btn-extende">
</div>
</div>
<div id="bodyProduct">
<div id="btn-extende">
</div>
</div>
<style>
#bodyProduct{
position: relative;
width: 960px;
height: 295px;
margin: 20px 60px;
display: block;
overflow: hidden;
}
#btn-extende{
z-index: 9999;
position: absolute;
width: 35px;
height: 18px;
background-color: #555;
bottom: 6px;
right: 6px;
overflow: hidden;
}
</style>
$('btn-extende').on('click', function(){
$('#bodyProduct').css('height', 'auto');
});