Hello there! I've encountered an issue with a script that I'm running. It is supposed to display the content in the hidden div when clicked, but for some reason, only the "show" element is working and not the "hide" element.
<script type="text/javascript">
$(function() {
$(".slidingDiv").hide();
$(".hide, .show").show().on('click', function(e) {
var elm = $(e.target).is('.show') ? $(e.target) : $(e.target).parent().prev('.show');
elm.toggle().next(".slidingDiv").slideToggle()
});
});
</script>
<style type="text/css">
.slidingDiv {
display: none;
height:200px;
width:auto;
}
</style
<div id="footer-widgets-container">
<div id="footer-widgets" class="col-full col-4"> <a href="#" class="show">Show</a>
<div class="slidingDiv">
<div class="block footer-widget-1 widget">
<div class="col1a"></div>
<div class="col3c"></div>
<div class="col2b"></div>
</div>
<div class="block footer-widget-2"></div>
<div class="block footer-widget-3"></div>
<div class="block footer-widget-4">
<div class="skype p"><a href="#"><p>Skype</p></a>
</div>
<div class="email p"><a href="#"><p>Email</p></a>
</div>
</div>
</div>
</div><a href="#" class="hide">Hide</a>
</div>