Gossamer Forum
Home : Products : DBMan : Customization :

I Need help with adding a javascript menu

Quote Reply
I Need help with adding a javascript menu
I want to add a javascript Mouseover drop down menu to DBman, or basically replace the Standard footer menu (Home, Search, Log off, etc).

Is there a specific type of script i should use? I.e. one that requires tables, has javascript in the head tag and body tag or just the body tag.

What i'm trying to do is to add some shortcut search options in the mouseover menu.



I have tried to add something to the HTML.pl file but i get "DBMan encountered an internal error. Please enable debugging to view."

Heres the javascipt i want to add :

<!--Links used to initiate the sub menus. Pass in the desired submenu index numbers (ie: 0, 1) -->
<a href="http://">Home</a>
<a href="http://" onMouseover="showit(1)">Search</a>
<a href="http://" onMouseover="showit(2)">Show recent additions</a>
<a href="http://" onMouseover="showit(3)">List all</a>
<a href="http://" onMouseover="showit(4)">Papers</a>
<a href="http://" onMouseover="showit(5)">Log off</a><br>

<!-- Edit the dimensions of the below, plus background color-->
<ilayer width=400 height=32 name="dep1" bgColor="#E6E6FF">
<layer name="dep2" width=400 height=32>
</layer>
</ilayer>
<div id="describe" style="background-color:#E6E6FF;width:400px;height:32px" onMouseover="clear_delayhide()" onMouseout="resetit(event)"></div>


<script language="JavaScript1.2">

var submenu=new Array()

//Set submenu contents. Expand as needed. For each content, make sure everything exists on ONE LINE. Otherwise, there will be JS errors.

submenu[0]=''

submenu[1]=''

submenu[2]='<font size="2" face="Verdana"><b><a href="http://">Music</a> | <a href="http://">Video</a></b></font>'

submenu[3]='<font size="2" face="Verdana"><b><a href="http://">Applets</a> | <a href="">Tutorials</a></b></font>'

submenu[4]='<font size="2" face="Verdana"><b><a href="">Applets</a> | <a href="">Tutorials</a></b></font>'

submenu[5]=''

//Set delay before submenu disappears after mouse moves out of it (in milliseconds)
var delay_hide=500

/////No need to edit beyond here

var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""

function showit(which){
clear_delayhide()
thecontent=(which==-1)? "" : submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()
}
}

function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}

function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

</script>

Where i have:

submenu[2]='<font size="2" face="Verdana"><b><a href="http://">Music</a>

Would be ok adding a search string as the href, like $db_script_link_url&view_records=1&so=ascend&sb=0&$db_key=* ? Would i need to add ! if ($per_view); after it?



Thanks for your help

Pete
Subject Author Views Date
Thread I Need help with adding a javascript menu manic 7274 Mar 5, 2003, 6:00 AM
Thread Re: [manic] I Need help with adding a javascript menu
esm 7089 Mar 5, 2003, 8:18 PM
Thread Re: [esm] I Need help with adding a javascript menu
manic 7067 Mar 6, 2003, 4:18 AM
Thread Re: [manic] I Need help with adding a javascript menu
esm 7059 Mar 6, 2003, 6:06 AM
Thread Re: [esm] I Need help with adding a javascript menu
manic 7041 Mar 6, 2003, 6:43 AM
Thread Re: [manic] I Need help with adding a javascript menu
esm 7096 Mar 6, 2003, 7:20 AM
Thread Re: [esm] I Need help with adding a javascript menu
manic 7059 Mar 6, 2003, 7:38 AM
Post Re: [manic] I Need help with adding a javascript menu
esm 7032 Mar 6, 2003, 10:20 AM
Thread Re: [manic] I Need help with adding a javascript menu
esm 7062 Mar 6, 2003, 6:55 PM
Post Re: [esm] I Need help with adding a javascript menu
manic 7059 Mar 7, 2003, 4:04 AM