Skip to content Skip to sidebar Skip to footer

Toggle Between Categories And Sub Categories Within The Same Div

I have a parent div called container. Within that div is a main category nav called togglelinks. This toggles between the div class within categories called people, there are about

Solution 1:

Let me know if this is what you want to do.

The fiddle navigates through people, business and highlife showing one section at at time.

jsFiddle

jQuery("a[data-toggle]").on("click", function (e) {
       e.preventDefault(); // prevent navigatingvar target = $(this).data('toggle');
       $('.people > div').hide();
       $('.people ' + target).fadeIn();
   });

Post a Comment for "Toggle Between Categories And Sub Categories Within The Same Div"