Quote:
Originally Posted by MagicThemeParks
Does anyone have step-by-step instructions on how to clean things up by having the javascript and CSS in separate files rather than all within the code in the template?
|
Don't exactly have step by step but I have successfully separated the CSS and js scripts out of the menu into files.
What resulted in my implementation was 2 css files and 5 .js files, each containing a section of the surrounding code. I had to load the external .js files in the same order as they were in the menu block given to us originally. I then called them in the headinclude template in the order I needed them:
Code:
<!-- Navbar Repplacement Files -->
<link rel="stylesheet" type="text/css" href="assets/css/cqm-menu.css" />
<link rel="stylesheet" type="text/css" href="assets/css/cqm-menuitems.css" />
<!-- Small section initialising the qmad object -->
<script type="text/javascript" src="assets/js/cqm-qmad.js"</script>
<!-- Menu 0 Add-On Settings -->
<script type="text/javascript" src="assets/js/cqm-aosetting.js"</script>
<!-- UKBL ~ Core Quality Menu Code -->
<script type="text/javascript" src="assets/js/cqm-menucode.js"</script>
<!-- Add-On Code: Rounded Sub Corners -->
<script type="text/javascript" src="assets/js/cqm-aorsubcnr.js"</script>
<!-- Add-On Code: Rounded Items -->
<script type="text/javascript" src="assets/js/cqm-aoritem.js"</script>
The names are of course my own naming convention to give me an idea of what is in each one.
I left the very last piece of .js code in the header template, haven't got as far as to try that in an external just yet.
I tested this with 3 browsers - Firefox 3.6.3, Safari 4.5 and Opera 10.10 on OSX Snow Leopard 10.6.3 and all browsers loaded fine and displayed the menu as "normal".
I would attach the files here if the author is OK with that otherwise just sort of follow what I did and you should be good to go.....
I did all this to see if I can replace the navbar sub-menu items in VB4 with this code so I can mimic my VB3 style in VB4
Cheers
Bruce