padding 0px
2005/05/17 19:54
Viewed 4878 times
Replies: 0/0
hi on my horizontal menu that drops down to vertical for submenus, it seems that in the active state with no mouse over the menu looks fine, but when i hoover over a horixontal menu item its effect is that of being 'de-pressed'. ithink that this effect is accomplished thru a simple cell padding left= 1px, top=1px. how do i get rid of this?
last
eliminating mouse over effect
2005/05/17 19:56
Viewed 4851 times
Replies: 0/0

hi on my horizontal menu that drops down to vertical for submenus, it seems that in the active state with no mouse over the menu looks fine, but when i hoover over a horixontal menu item its effect is that of being 'de-pressed'. ithink that this effect is accomplished thru a simple cell padding left= 1px, top=1px. how do i get rid of this?

last
Odd namespace poisoning issue with Opera
2005/05/20 09:10
Viewed 4817 times
Replies: 0/0

I've been playing around trying to get context menus working on images, with a different menu for each part of the image and with the ability to process information about the part of the image the menu was activated from (it's for drill down grpahing in case anyone is wondering). Anyway, I've pretty much got it working the way I want but ran into an issue with Opera that stumped me for a bit and I thought I would report it.

My test script is located here... http://mrchook.homeip.net:1500/~mca/test/context_menu/img_context.htm

To do what I wanted I used custom parameters on the AREA tags in the image map to hold the arguments relating to the area and custom parameters on the LI tag that forms the menus to determine the menu action and then used a custom javascript handler to process the action like this...

  function my_handler(action) {
var item = action.info;
var triggerElement = item.menu.target;
var arg1 = triggerElement.getAttribute("arg1");
var arg2 = triggerElement.getAttribute("arg2");
alert("menu_action = " + action.params.getAttribute("menu_action") + "\narg1 = " + arg1 + "\narg2 = " + arg2);
};

This works very well.  Now to the problem, if I replace the custom attribute name with "action" (which I originally used, hence this problem) instead of "menu_action" then Opera 8 thinks that the action is, for example "http://mrchook.homeip.net:1500/~mca/test/context_menu/action_1" instead of just "action_1".  It works fine in FF and IE with either name.


The only other problem I can see is that the context menu should work for both left and right click, however for IE it only works on the left click.  I can't seem to see where I have gone wrong on that (also, Opera only works on the right click but that's another issue I already know about)


Cheers,

Michael

last
Floating Menus, Context on Click, Callback for Disabling Menu It
2005/06/02 03:11
Viewed 5331 times
Replies: 2/2
by Ed

Hi Mihai,

I downloaded the eval version yesterday night and I have to say it; I'm amazed on how straight forward it was to come up with simple menus. Very cool stuff you have put together.

I just finished read all threads and I have a few questions:

1) How do you do the nifty floating menu you have on the left hand side of your site -- I presume it is easy to do with the DynarchMenu, but I did not find an example and the pages on your site are a bit of a challenge to reverse engineer for my limited JS understanding. So a minimalist example like you have for the other features would be cool.

2) How do you get the context menu to show up at a mouse click? See right-click functionality is something very few people would expect on the web... cuz it has been so hard to do till the DynarchMenu came about ;-). Anyway, the idea to use the context menu is to simply put an anchor tag that says "options" and when the person clicks on it the context menu shows up.

3) That also means that there would be about 100-200 span/div tags where the context menu(s) could be called from. Would my page be slow to initialize with that many items?

4) On the context menu, is there a way to set up a callback function before activation so that we can disable/gray out menu elements that are not applicable to that instance of the div/span?

5) Please don't shoot me, but I have to ask... will DynarchMenu work on WebTV "browsers" ?
* ducks... * ;-)

Thanks.

Your menu and your calendar rock!

last
Re: Floating Menus, Context on Click, Callback for Disabling Men
2005/06/02 03:18
Viewed 7169 times
Replies: 0/0
by Ed

One more thing. It just occurred to me that a cheap (resource-wise) solution would be to call a function to invoke the context menu with the id of the div/span and perhaps the onmouseclick event properties. That function could enable/disable any menu items that are not appropriate for that element and then invoke the context menu. Does that make sense? Can that be done? Are there enough hooks to make this happen?

Thanks!

last
Re: Floating Menus, Context on Click, Callback for Disabling Men
2005/06/02 11:28
Viewed 7052 times
Replies: 0/0
At 2005/06/02 03:11, edhoo wrote:

I downloaded the eval version yesterday night and I have to say it; I'm amazed on how straight forward it was to come up with simple menus. Very cool stuff you have put together.

Thanks. :-)

1) How do you do the nifty floating menu you have on the left hand side of your site -- I presume it is easy to do with the DynarchMenu, but I did not find an example and the pages on your site are a bit of a challenge to reverse engineer for my limited JS understanding. So a minimalist example like you have for the other features would be cool.

Actually that isn't a feature of DynarchMenu.  It's very easy to do for browsers that support the CSS “position: fixed” attribute, that is, all but Internet Explorer.  For Internet Explorer there is an ugly CSS hack which involves writing the page content in a DIV with "overflow: auto" and including the fixed elements outside that DIV (so we're shifting the scroll area from the BODY to a different element, so that all elements directly inside the BODY will stay fixed).  It's easy to find more information. ;-)

2) How do you get the context menu to show up at a mouse click? See right-click functionality is something very few people would expect on the web... cuz it has been so hard to do till the DynarchMenu came about ;-). Anyway, the idea to use the context menu is to simply put an anchor tag that says "options" and when the person clicks on it the context menu shows up.

You can assign a context menu on any element for either the right or the left button, or both if you wish (see the context2.html sample).

3) That also means that there would be about 100-200 span/div tags where the context menu(s) could be called from. Would my page be slow to initialize with that many items?

I don't think so, unless you have 200 different context menus.  Setting up a context menu for multiple elements involves these steps:

  1. build the menu (that's the heavy part)
  2. lookup all elements in the document, by tag name and class name, that need to get a menu
  3. for each element assign the appropriate event, depending on the desired mouse button.
So you see, the heavy operation is done once.

4) On the context menu, is there a way to set up a callback function before activation so that we can disable/gray out menu elements that are not applicable to that instance of the div/span?

First off, you can create different menus for different elements and assign them all in one function call (see context.html).

On the other hand, I do agree that some hook should be called--and it will allow one to dinamically modify the menu by showing/hiding or enabling/disabling items.  This hook doesn't yet exist but I can promise you that it will. ;-)

5) Please don't shoot me, but I have to ask... will DynarchMenu work on WebTV "browsers" ?
* ducks... * ;-)

/me is loading the gun... :-p

I have no idea if it works on WebTV, but basically, it should work on any browser so long as it correctly respects Web standards (well, and some “oldies but goodies”, like the offsetLeft, offsetTop properties, etc.--which are so widely used that I guess no browser should afford not to support them).

last
Need to reduce margin on left of items
2005/06/02 14:09
Viewed 5110 times
Replies: 1/5

Want to eliminate the small image area at the left of the text of a menu item. I have not found out where this is defined. Really just want the text flush to the left of the menu maybe with a small 1 or 2 pixel margin. The area defined for images is too large.

Thanks

last
Re: Need to reduce margin on left of items
2005/06/02 14:50
Viewed 7113 times
Replies: 2/4

Just look in src/hmenu.css for occurrences of "width: 18px" (should appear 2 times) and replace them with "width: 0".

Alternatively—a better solution if you don't want to modify the original files—you can put the following lines somewhere in your own CSS file (needs to be loaded after the DynarchMenu skin):

div.dynarch-popup-menu tr.item td.icon img,
div.dynarch-popup-menu tr.item td.icon div {
width: 0;
}
div.dynarch-popup-menu tr.item td.icon {
width: 0;
}

After this, if there are items where you would like to include an icon, you may put the <IMG> tag inside the <A> tag, but note that in this case it's usually impossible to achieve perfectly centered vertical alignment.

last
Any differences between trial and registered versions...?
2005/06/02 16:04
Viewed 4797 times
Replies: 1/1

Not sure if this is why, but after installing the registrered version some of our menus do not work in NS or FF but do in IE....IE on the PC but not on the Mac. Still trying to track things down but how could a menu just not show at all on one browser and work fine on another?

last
Re: Any differences between trial and registered versions...?
2005/06/02 16:09
Viewed 6589 times
Replies: 0/0

DynarchMenu does not support IE for the Mac, sorry about this.

On one hand, it's nearly impossible to do any non-trivial DHTML stuff on that browser, and on the other, IE/Mac was discontinued by Microsoft about 2 years ago—so it shouldn't matter all that much nowadays.

last
Context menus on images
2005/06/03 03:24
Viewed 4805 times
Replies: 2/2

This relates a little to my earlier post regarding namespace poisoning in Opera (only in that it's the same code). The example is now at http://tams.com.au/~mca/image_context_menus/img_context.htm .

The problem I'm having is getting a consistent interface across the 3 browsers that I care about (Opera, Firefox and IE). I have set it to activate on both left and right mouse buttons which works fine in FF but I can only get right click in Opera and left click in IE. I'd be happy to have only one button to activate the menu but I'd like it to be consistent if at all possible.

Is it possible to capture the right click event on an img tag in IE ? That seems to be the problem (i.e. I'm seeing the normal context menu that you see when clicking on an image)

Cheers,
Michael

last
Re: Context menus on images
2005/06/03 07:10
Viewed 6528 times
Replies: 0/0

adf

last
Re: Context menus on images
2005/06/03 07:23
Viewed 6444 times
Replies: 0/0

Bugger, sorry about that, what I meant to say was this...

I've done a little more playing around with very simple html/js tests to see what is going on. It looks to me that IE simply ignores any oncontextmenu trigger set on an area tag even though the MSDN site indicates that oncontextmenu is applicable to it. The other alternative is that it's not ignored but never actually gets to it (I'm thinking here that the img event is triggered before the area event and so never gets to the area).

Alas, I think I'm screwed with what I wanted to do. I had hoped to have the usual href tag on the area used to drill down to the "default" subgraph with a left click and then use the rigth click context menu to allow the user to select the subgraph they want. This works well in FF and Opera but fails miserably in IE due to the above limitation. The only other possibility I can think of is to somehow allow a modifier key to be used to trigger the menu. Unfortunately I think this would require a reasonably complex change the the dynarch menu code...

I just did some testing and a little hack to the code. In the definition of the ctx_onContextMenu event function you had the following
if(!is_opera||ev.button==2)

Now, this explains somthing else that's been bugging me. In opera you are using the onclick and onmousedown event to trap the left and right clicks when setting up the context menu and then calling the ctx_onContextMenu handler function, then in the handler you test to see if the button is the right button and then do nothing if it's not... which explains why the left click context menus don't work in Opera!

Getting back to my original topis though, I replaced that test above with this
if(ev.shiftKey)
This pretty much gives me what i was after in this particular instance, i.e. a left click does the normal action and a shift-left click gives me the context menu.

Obviously this quick hack is not the "right" way to do it as we don't necessrily want this behviour on all context menus. Is there some way to turn this into a more correct implemenatation that can be better controlled? Perhaps store something in the _msh_info2 object that defines what modifiers are required to trigger the menu?

Cheers,
Michael

last
Context Menu Positioning + Max Number of setupContent calls
2005/06/03 04:26
Viewed 4939 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.

:-)

last
Google