...

View Full Version : Repeat Jquery navbar on multiple pages



ShamAce
08-22-2012, 03:55 PM
I am rebuilding a site, replacing Flash navigation with Jquery/CSS/HTML5.

I am getting fluent in the scripting, but this may be a dumb newbie question: Once I write my navbar script, how do I call it on each page? I want to be able to change all pages simultaneously should I need to add a link, let's say.

I do not want to use PHP, which would require a new learning curve.

I'd appreciate any help. Direct email is fine.

Shamace

DrDOS
08-22-2012, 04:37 PM
Actually if you have php on your website it will be very easy to use it. Here is all the 'learning curve' you need. If your navbar is 'fixed' code, that is, it has no php variables of any kind, and can be written as a plain text file, even if it includes javascript and css, just name it navbar.txt and put this where you want to locate it on a page:


<?php include("navbar.txt"); ?>


Of course you need to give the correct path. php will just write the text verbatim to the page, and it will need to be done for every page.

ShamAce
01-28-2013, 04:01 PM
Actually if you have php on your website it will be very easy to use it. Here is all the 'learning curve' you need. If your navbar is 'fixed' code, that is, it has no php variables of any kind, and can be written as a plain text file, even if it includes javascript and css, just name it navbar.txt and put this where you want to locate it on a page:


<?php include("navbar.txt"); ?>


Of course you need to give the correct path. php will just write the text verbatim to the page, and it will need to be done for every page.

This works fine, but the inserted content appears without any of the CSS or JQ applied to it.

If I give you the main page in html, can you help me build one .php page. I will pay.

tim in pa

jerry62704
01-28-2013, 05:43 PM
Make the css is included (or make it a PHP include) on each page. You are using a separate file for the css?

ShamAce
01-28-2013, 06:08 PM
Make the css is included (or make it a PHP include) on each page. You are using a separate file for the css?

Yes, I am using a separate file for css and jq. how do I include (or call) them on a .txt page?

Thanks,

ace

DanInMa
01-28-2013, 08:39 PM
couldnt he do an echo to a script and css block so he doesnt have to change the css and js file to .txt?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum