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

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -