Skip to content Skip to sidebar Skip to footer

Idea On Content Passing. Help Needed

Core Question I need help coming up with a concept to achieve my goal. I am having a problem coming up with an idea to how I can navigate the DOM properly with the method I have c

Solution 1:

Instead of manually setting display:block and display:none, you could use a class. Select the section that is .active, and select the pageNav from there:

var navContent = document.getElementsByClassName('active')[0].getElementsByClassName('pageNav')[0]

CSS

#contentBody > section { display:none; }
#contentBody > section.active { display: block; }

Solution 2:

A good way do handle the page state and detect what content should be visible is the html5 history api. It also has the advantage that the url is updated on content changes (something i was missing on "the mind company"). Check out the mozilla page or google some examples. https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history

Post a Comment for "Idea On Content Passing. Help Needed"