I've implemented a jQuery function to expand one div when another is clicked:
<script type="text/javascript">
$(document).ready(function() {
$(".flip").click(function() {
$(".module").slideToggle("slow");
});
});
</script>
Here's the corresponding HTML code:
<div class="flip"></div>
<div class="module"></div>
The module div contains a lot of text. This is the accompanying CSS:
.module {
width:374px;
height:100%;
float:left;
padding:5px;
display:none;
}
.flip {
width:100%;
height:25px;
background-image:url(menu.gif);
cursor:pointer;
}
My website is responsive, so the CSS mentioned above is applied when the screen size is less than 800px. When testing, expanding and collapsing the module works perfectly. However, if I hide the content by resizing the window to below 800px and then resize it back to say 1000px, the content remains hidden even though the button for larger screens has been hidden. Is there a way to reset the jQuery effects when the browser window is resized to over 800px?