javascript - Toggle container open when click on link -
i'm trying create website navigates trough links. when click on highlighted text sends me different part on website. part of text inside toggle container opens when clicked. i'm using following code, not working.
<div class="toggle-wrap"> <span id="eindhoven" class="toggle-title">eindhoven</span> <div class="toggle_container"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat </div> </div> <script> $(document).ready(function(){ if (window.location.hash.indexof('eindhoven')==1) { $('toggle_container').show(); } }); </script>
not sure if it's solution, you're not specifying kind of selector want show:
$('.toggle_container').show();
you need "." specify it's class you're looking for.
Comments
Post a Comment