forums
You are not logged in.
I have been trying to put the smarmenus scripts into their own subdir but whenever i try this the menus no longer work....and on the screen it prints out part of the code that is in my index page:
((something like this))
<script language=JavaScript1.2 src='s_array.js'></script>
I have changed the path in the index file to be scripts/s_array.js...
I am sure that i am just missing something simple but i have looked through all of it and am stumped. I have also tried to change the other paths within hte loader script....at the beginning....
Any help would be greatly appreciated.
Thank you in advance,
Jeremy ![]()
Offline
Hi,
Please download this example http://www.smartmenus.org/down/example_ … tories.zip .
It is specially created for people with your problem.
Cheers!
Offline
I did download that but i am not sure because it uses frames and also i looked throught the scripts and never found where ROOT was defind. Or does is just know that it is the name of your root directory? Not sure the differences of using the script w/o frames...would i just omit the added on frame scripts?
Thank you,
Jeremy Dawson
Offline
The ROOT var is defined in every page that has to contain the menus between the <HEAD> and </HEAD> You will see it in the source of the pages that are loaded in the bottom frame in the example.
Not sure the differences of using the script w/o frames...would i just omit the added on frame scripts?
YES. Assume the pages that load in the bottom frame as your normal non-framed pages.
I hope you will cope!
Cheers!
Offline
UPDATE:
The above solution is great because once configured, your setup will work correctly both offline and online on your server.
However, if you only want the menus to work online on your server, there's a simpler solution. Just use absolute path for all the links in s_loader.js and s_arrays.js (for the sub images too). For instance, put all menu script files (including the sub menu indicator images) in a sub directory on the server. Let's say "menus". And then set all paths like this:
in s_loader.js:
s_The_Arrays_Source='http://your_server/menus/s_arrays.js';
s_Script_DOM_Source='http://your_server/menus/s_script_dom.js';
...
for the sub images in s_arrays.js:
'http://your_server/menus/arrow.gif', // SubImgSrc
'http://your_server/menus/arrowover.gif', // OverSubImgSrc
...
and for the links in s_arrays.js:
{U:'http://your_server/index.php',T:'Home'},
{U:'http://your_server/sub_dir/download.php',T:'Download'},
...
Or you can also use shorter syntax and replace the "http://your_server/" prefix with just "/" like this:
in s_loader.js:
s_The_Arrays_Source='/menus/s_arrays.js';
s_Script_DOM_Source='/menus/s_script_dom.js';
...
for the sub images in s_arrays.js:
'/menus/arrow.gif', // SubImgSrc
'/menus/arrowover.gif', // OverSubImgSrc
...
and for the links in s_arrays.js:
{U:'/index.php',T:'Home'},
{U:'/sub_dir/download.php',T:'Download'},
...
Thanks!
Offline