PDA

View Full Version : AnyLink Drop Down Menu Problem



JimC
07-18-2008, 01:21 PM
1) Script Title: AnyLink Drop Down Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

3) Describe problem:
Exactly as is this script works.
Instead of a Text link with an Anchor tag I would like to use a Cell in a table with mouseover, mouseout, and onclick events - this sounds easy enough to do but I am getting an error when I do that:

I left code in header exactly as described on page above... I linked using this code:

-----------------------------------------------------------------
<table border="0" width="100%" id="table1" bgcolor="#336666">
<tr><div id="menu1">
<td align="center" bgcolor="#F2EBE3" onmouseover="FP_callJS('dropdownmenu(this, event, menu1, \'150px\')')" onmouseout="FP_callJS('delayhidemenu()')" onclick="FP_callJS('return clickreturnvalue()')">
<b><font face="Arial Narrow" size="2">SAMPLE1</font></b></td></div>
<td align="center" bgcolor="#F2EBE3"><b>
<font size="2" face="Arial Narrow">SAMPLE LINK 2</font></b></td>
<td align="center" bgcolor="#F2EBE3"><b>
<font face="Arial Narrow" size="2">ONE MORE SAMPLE</font></b></td>
</tr>
</table>
-----------------------------------------------------------------
The error is an invalid object on this line of code:

dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"

jscheuer1
07-18-2008, 02:39 PM
Don't use FP_callJS(). And you don't need the onclick, all that does is cancel the default onclick, but there is no default onclick for a td:


<td align="center" bgcolor="#F2EBE3" onmouseover="dropdownmenu(this, event, menu1, '150px');" onmouseout="delayhidemenu();">


The main reason that FP_callJS() messes this up is probably that event no longer means what it did in the original syntax. I can't think of any reason to use FP_callJS(), but I'm not sure exactly what it is. It looks to me to be some sort of (perhaps well intended) nonsense from Front Page, is it?

JimC
07-18-2008, 02:46 PM
Beautiful... that was it.