$('a').click(function(event) {
event.preventDefault();
// Storing the scrollY position before browser scrolls to :target
var scrollTop = window.scrollY;
// Manually changing the hash
location.hash = $(this).attr('href');
// Scrolling back to the saved scroll position
window.scrollTo(0, scrollTop);
});
#aconmine {
margin: 0px auto;
width: 90% !important;
box-shadow: 0 0 5px black;
border: solid 3px white;
}
.aconmineli {
list-style: none;
border: 1px 1px 1px 1px #efefef solid;
background-color: #2A5581;
display: block
}
.aconmineli h2 {
margin: 0;
padding: 10px;
font-size: 18px;
font-family: Arial, Helvetica, sans-serif;
color: #ecf0f1;
border-bottom: 1px #efefef solid;
background: #1D3D5F;
background-image: url("http://p315468.for-test-only.ru/wp-content/uploads/2014/09/down.png");
background-position: right 20px center;
background-repeat: no-repeat;
background-size: 30px auto;
box-shadow: 0 5px 5px rgba(0, 0, 0, 0.59);
}
.aconminecontent {
max-height: 0;
overflow: hidden;
-webkit-transition: max-height 0.73s ease-out, opacity 0.7s ease 0.3s, padding-bottom 1s ease;
-moz-transition: max-height 0.73s ease-out, opacity 0.7s ease 0.3s, padding-bottom 1s ease;
-ms-transition: max-height 0.7s ease-out, opacity 0.7s ease 0.3s, padding-bottom .5s ease;
/* IE10 is actually unprefixed */
-o-transition: max-height 0.7s ease-out, opacity 0.7s ease 0.3s, padding-bottom .5s ease;
transition: max-height 0.7s ease-out, opacity 0.7s ease 0.3s, padding .5s ease;
opacity: 0;
}
.aconminecontent:target {
max-height: 1000px !important;
border-bottom: 1px solid #EFEFEF;
overflow: visible !important;
opacity: 1;
margin-top: -220px;
padding: 200px 20px 20px 20px;
}
.aconminecontent:target .closeme {
background-image: url("http://p315468.for-test-only.ru/wp-content/uploads/2014/09/up.png");
background-position: right;
background-repeat: no-repeat;
background-size: 30px auto;
}
.aconminecontent p {
padding: 10px;
color: #ecf0f1;
margin-top: -47px;
}
.closeme {
height: 43px;
width: 100%;
display: block;
transform: translate(0, -23px);
}
.aconmineli a {
transition: height .2s ease-in-out;
height: 43px;
border-bottom-left-radius: : 10px;
text-decoration: none;
}
.aconmineli a:hover {
height: 49px !important;
display: block !important;
opacity: 1
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<br><br><br><br><br><br><br><br><br><br>
<div id="aconmine">
<div class="aconmineli"><a href="#tab1"><h2>Group 1 </h2></a>
<div id="tab1" class="aconminecontent">
<a href="#tabcloseme" class="closeme"></a>
<br><br><br><br><br><br><br><br><br><br>
</div>
</div>
<div class="aconmineli"><a href="#tab2"><h2>Group 2 </h2></a>
<div id="tab2" class="aconminecontent">
<a href="#tabcloseme" class="closeme"></a>
<br><br><br><br><br><br><br><br><br><br>
</div>
</div>
<div class="aconmineli"><a href="#tab3"><h2>Group 3 </h2></a>
<div id="tab3" class="aconminecontent">
<a href="#tabcloseme" class="closeme"></a>
<br><br><br><br><br><br><br><br><br><br>
</div>
</div>
<div class="aconmineli"><a href="#tab4"><h2>Sports Items </h2></a>
<div id="tab4" class="aconminecontent">
<a href="#tabcloseme" class="closeme"></a>
<br><br><br><br><br><br><br><br><br><br>
</div>
</div>
<div class="aconmineli"><a href="#tab5"><h2>Textile Articles</h2></a>
<div id="tab5" class="aconminecontent">
<a href="#tabcloseme" class="closeme"></a>
<br><br><br><br><br><br><br><br><br><br>
</div>
</div>
<div class="aconmineli"><a href="#tab6"><h2>Leather Goods </h2></a>
<div id="tab6" class="aconminecontent">
<a href="#tabcloseme" class="closeme"></a>
<br><br><br><br><br><br><br><br><br><br>
</div>
</div>
<div class="aconmineli"><a href="#tab7"><h2>Natural Fur Products </h2></a>
<div id="tab7" class="aconminecontent">
<a href="#tabcloseme" class="closeme"></a>
<br><br><br><br><br><br><br><br><br><br>
</div>
</div>
<div style="position: fixed; top: 0px;"></div>
</div>
<br><br><br><br><br><br><br><br><br><br>