port4u
10-12-2006, 12:19 PM
Slashdot menu
http://www.dynamicdrive.com/dynamicindex1/slashdot.htm
I am using the slashdot menu on my test site and I can get it to work with the slashdot html files in the root and then seeking the js script in another folder. When I make a sub directory iwith more html files they no longer find the *.js script. Is there a way to use only one *js file and have all the html files find it no matter what the folder structure is. I am assuming there is a way to modify all the html files to search for the *js file in one location on the site.
Right now the script in the header of my html m=pages lookes like this:
<script language="JavaScript" type="text/javascript" src="../scripts/dahlgren.js"></script>
<script language="JavaScript" type="text/javascript">
I modified the JS links to the files need for th emenu. That is part of the problem. The html files need to find the images.
Here is a sample of the script for that: function slash_expandall(){
if (typeof menu!="undefined"){
for(i=0; i<Math.max(titles.length, submenus.length); i++){
titles[i].className="title";
arrows[i].src = "menu_files/expanded.gif";
submenus[i].style.display="";
submenus[i].style.height = heights[i]+"px";
}
}
}
function slash_contractall(){
if (typeof menu!="undefined"){
for(i=0; i<Math.max(titles.length, submenus.length); i++){
titles[i].className="titlehidden";
arrows[i].src = "menu_files/collapsed.gif";
submenus[i].style.display="none";
submenus[i].style.height = 0;
}
}
}
At the moment I made a messy work arround. I duplicated the JS file and the menu files and put those in the other directories that the other html files are in. :(
http://www.dynamicdrive.com/dynamicindex1/slashdot.htm
I am using the slashdot menu on my test site and I can get it to work with the slashdot html files in the root and then seeking the js script in another folder. When I make a sub directory iwith more html files they no longer find the *.js script. Is there a way to use only one *js file and have all the html files find it no matter what the folder structure is. I am assuming there is a way to modify all the html files to search for the *js file in one location on the site.
Right now the script in the header of my html m=pages lookes like this:
<script language="JavaScript" type="text/javascript" src="../scripts/dahlgren.js"></script>
<script language="JavaScript" type="text/javascript">
I modified the JS links to the files need for th emenu. That is part of the problem. The html files need to find the images.
Here is a sample of the script for that: function slash_expandall(){
if (typeof menu!="undefined"){
for(i=0; i<Math.max(titles.length, submenus.length); i++){
titles[i].className="title";
arrows[i].src = "menu_files/expanded.gif";
submenus[i].style.display="";
submenus[i].style.height = heights[i]+"px";
}
}
}
function slash_contractall(){
if (typeof menu!="undefined"){
for(i=0; i<Math.max(titles.length, submenus.length); i++){
titles[i].className="titlehidden";
arrows[i].src = "menu_files/collapsed.gif";
submenus[i].style.display="none";
submenus[i].style.height = 0;
}
}
}
At the moment I made a messy work arround. I duplicated the JS file and the menu files and put those in the other directories that the other html files are in. :(