Hi to you all!
I am very new to jquery and javascript and i have a problem.
I found a jquery menu on the web and put it to my webpage. The menu consists out of <li> tags. And now I would like to change the visibility of content divs; so i click on the menu and the content displayed disapears and the coresponding content to the menu appears. I tried adding id's to <li> and all sorts of stuff but nothing worked. The point is that i have 5 content divs and i only change the visibilities.
I apologise for my bad language, here's some code:
- <ul id="menu">
- <li value="1" id="home"><a href="#">Domov</a></li>
- <li id="pay"><a href="#">Opis plačil</a></li>
- <li id="betPlace"><a href="#">Opis stavnic</a></li>
- <li id="bets"><a href="#">Vrste stav</a></li>
- <li id="contact"><a href="#">Kontakt</a></li>
- </ul>
- <!-- here are the content divs-->
- <div id="domov" class="vsebina">
- To je Domov
- </div>
- <div id="placila" class="vsebina">
- Gremo na plačila!
- </div>
- <div id="stavnice" class="vsebina"></div>
- <div id="stave" class="vsebina"></div>
- <div id="kontakt" class="vsebina"></div>
- *********jquery*********
- var zadnji="domov";
- $(document).ready(function(){
- $("#home").click(function() {
- $("#"+zadnji).fadeOut("slow", function(){
- $("#domov").fadeIn("slow");
- });
- zadnji="domov";
- });
-
- $("#pay").click(function() {
- $("#"+zadnji).fadeOut("slow", function(){
- $("#placila").fadeIn("slow");
- });
- zadnji="placila";
- });
- });
This code doesn't work.
Thanks a lot for your help!