iTux iTux - 1 year ago 75
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) {


Answer Source

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

var curPage="";

  curPage = "page1"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download