» Forums
» DynarchMenu forum
» Support
» Context Menu Positioning + Max Number of setupContent calls
Context Menu Positioning + Max Number of setupContent calls
2005/06/03 04:26
Viewed 5668 times
Replies: 1/3
by Ed

Hi Mihai,

...I made quite a bit of progress from yesterday ;-)

A couple of more questions:

1) Is there a limit as to how many times we can attach a menu to an object with something like this (perhaps a memory leak, a browser bug, or something like that)?  I would like to create some 10 individual context menus and attach then to different objects as the selections in a form change, so there would be  no limit as to how many times they would be reassigned.

var e = document.getElementById('my_element_id');
e.className = 'my_class dynarch-menu-ctxbutton-left';
DynarchMenu.setupContext(e, my_global_context_menu.items['my_sub_menu_name']);

2) Is there a way to have the context menu positioned in relation to the <span>, <img> or <a> tag we are associating it with?  I wanted to make it aligned as if it were a drop down menu and the <span>, <img> or <a> were its "parent".   So it would drop down left-bottom-aligned to that control/tag and not pop up next to the mouse pointer as the samples do.  It would make for a more "organized" look.

BTW: The lazy initialization rocks!  The attaching of the menu to 200 tags I asked you before was fast and worked like a charm.  The setupContext function above solved most of my problems, it would be nice to be able to disable/gray out individual items as we talked about before, but for now I could display "you-stupid-user type messages ;-)".  Overall I'm really impressed. So far I have been able to figure out how to do everything I want to with your menus. :-)

One wishy-washy, but nice to have feature... a standard ready-to-plug-in "preferences" menu with the ability for the user to save the settings in their cookies.

:-)

Misaligned SubMenus in IE6 when inside table
2005/06/04 19:58
Viewed 7833 times
Replies: 1/2
by Ed

Hi again,

It is the weekend, so you probably have not seen the post above. ;-)


So... I just purchase DynarchMenu.  It was very easy to setup, even for complex stuff.  Most of my troubles had to do with generating the hierarchical syntax properly from the database rows.  it gets tricky if you have unlimited levels, etc. but that is a function of my data not your tool.

Anyway, besides the 2 questions above I run into an actual problem.  It has to do with with the <!DOCTYPE> declaration in IE 6.  DynarchMenu does not correctly align the popup of a menu inside a table when the declaration is present.

Here is a test file.  Place it under the hmenu-2.4.2/ directory in the standard distribution and it should run.  It will misalign the popup menu in IE6.  It will work as intended if you remove the 1st line.

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'DTD/xhtml1-transitional.dtd'>
<htm  xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">@import url("./src/skin-xp.css");</style>
<script type="text/javascript">_dynarch_menu_url = "./src/";</script>
<script type="text/javascript" src="./src/hmenu.js"></script>
</head>

<body onload='DynarchMenu.setup("trail-menu",{electric:1000});'>

<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tr>
        <td>
            <ul id="trail-menu">
                <li>_Bugger</li>
                <li>_Misalign-me
                    <ul>
                        <li><a href="/test-201">test-201</a></li>
                        <li><a href="/test-202">test-202</a></li>
                        <li><a href="/test-203">test-203</a></li>
                    </ul>
                </li>
            </ul>
        </td>
    </tr>
</table>

</body>
</html>

OMG!!!

Is there hope?  Am I doing something wrong? -- besides using IE that is.

Thanks!

last
Re: Misaligned SubMenus in IE6 when inside table
2005/06/05 04:42
Viewed 10152 times
Replies: 1/1
by Ed

Found a workaround...

body { margin: 0; }

Then

<body>
    <div id='contents' style='margin:10px 10px 10px 10px;'>
       * your whole web page goes here *
    </div>
</body>

Not sure what will happen in other browsers, but it is okay in IE6 and Firefox 1.0.2

Let me know if there is a better fix.

last
Google