I want to make a website that will have multiple pages, but because of a unique navigation bar, I cannot simply link to a new file for each page. What is the best way to accomplish this. Some possibilities that I can think of are having all of them on one page, but using css and javascript to move the other pages offscreen, or using iframes and loading them with javascript. Could someone please direct me to some examples or tutorials?
Share
Use jQuery to load up pages as they are clicked from the navigation. Simply have a containing divider (
<div>) which the page will load into.This will load the pages without reloading.
IFF (not a typo, it means “If and Only If”) you want support for browsers without Javascript enabled, use an iFrame, but then in your javascript remove it from the browser as it’s very bad practice to use iFrames.
HTML would look like:
Not tested, but concept should work (http://jsfiddle.net/Ns2Gx/)