I have a fairly simple menu that works as intended, but I just don't know how to add a transition to it so it will look smoother. Here is what I have:
<script type="text/javascript">
function showhide(id) {
var e = document.getElementById(id);
e.style.display = (e.style.display == 'block') ? 'none' : 'block';
e.style.transition = "all 1s";
}
</script>
<a href="javascript:showhide('SERIES')">
<div class="search-menu-maincategory">
Maincategory to click on
</div>
</a>
<div id="SERIES">
<div class="search-menu-subcategory">
One of the subcategories to show and hide
</div>
</div>
Obviously the e.style.transition = "all 1s"; part is not what I need since it is not working. How can I add a one second transition between the show and hide? Thanks!