iTux iTux - 4 months ago 33
HTML Question

show hide content from Div, show first by default

I was looking for some code to show / hide divs according to item selected from the menu. I found this code, but only works having all divs hidden from start. Could somebody help to modify it to show first option by default?

Here is the fiddle I found

I have tried to toggle the view, but it not working :)

var curPage="";
$("#menu a").click(function() {
if (curPage.length) {



If you want the first option to show by default, add this to the top (where curPage is)

var curPage="";

  curPage = "page1"