I am having different div's on my website and I would like to do following
- when I am clicking one link, that will trigger a change inside the css code of more than one div's. For example if I click on clients I would like to make the ul element with class="rslides" to get property of heigh="0px" and than another div layer to expand below this one.
But I have 2 problems:
- first is that I am using a responsive slider for which i to make its height="0px" , I have to change the class property.
- other issue is how to make one link trigger 2 actions for the second div. I tried with triggers but it is limited to one element per "id"
DOM Structure:
<div id="slider">
<div id="index_slider">
<ul class="rslides" >
<li><img src="img/index_design_02.jpg"></li>
<li><img src="img/index_design_03.jpg"></li>
</ul>
</div>
</div>
JS CODE:
<script src="js/responsiveslides.min.js"></script>
<script>
$(function() {
$(".rslides").responsiveSlides({
speed: 1000,
maxwidth: 1200
});
});
</script>
<div id="menu"><a href="#rslides">clients</a></div>
<div id="second_slider"></div>
THE CSS CODE fot the both tirgers of the slider:
.rslides {
position: relative;
list-style: none;
overflow: hidden;
width: 100%;
padding: 0;
margin: 0;
-webkit-transition:all 1s ease-in-out;
}
.rslides:target {
position: relative;
list-style: none;
overflow: hidden;
width: 100%;
padding: 0;
margin: 0;
height:0px;
}
Here is link to JSfiddle
where my goal is once clicked on the link the div called "menu" to go on the top with sliding transition and the other div called "second_slider" to expand on the bottom, and the slider to disapear.