htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
Button coordinate


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


Joshua
Novice

Dec 28, 2004, 2:04 AM

Post #1 of 4 (5353 views)
Shortcut
Button coordinate Can't Post

Is there any way to get the position of the button you click on?. I have made a div-layer(menu) and I want this menu to be placed under the button even if I change the order. Now I have to enter the coordinats in the code but that doesn't work when the order of the buttons or if the page scrolls in vertical limit. Then my menu will be placed over the buttons or somewhere else.

I'm sorry for my poor english but what I were thinking of is a way to copy Luis Formmenu or table operations. Luis version I look at: http://www.webstationone.com/test/htmlarea/

How do you calculate where these kind of menus are printed? I guess you need to know the buttons coordinate, but how?

Please help!


(This post was edited by Joshua on Dec 30, 2004, 5:32 AM)


Joshua
Novice

Dec 30, 2004, 5:37 AM

Post #2 of 4 (5335 views)
Shortcut
Re: [Joshua] Button coordinate [In reply to] Can't Post

Like this image.
Attachments: test.jpg (15.7 KB)


Luis
Veteran

Dec 30, 2004, 2:06 PM

Post #3 of 4 (5330 views)
Shortcut
Re: [Joshua] Button coordinate [In reply to] Can't Post

Hi Joshua:

It's pretty easy. Search for this code in editor.js and add the line in red:

editor_focus(editor_obj);
// get index and value for pulldowns
var idx = button_obj.selectedIndex;
var val = (idx != null) ? button_obj[ idx ].value : null;
if (0) {} // use else if for easy cutting and pasting
else if (cmdID){alert("x="+event.clientX + "\ny="+event.clientY);}


To work around each button, you can use for example:

else if (cmdID.toLowerCase() == 'showTablesmenu') {
showTablesmenu(objname); //pass the objname to the function
}

and in the function that display your menus, find the coordinates and apply them to position your divs:

function showTablesmenu(objname){
alert("x="+event.clientX + "\ny="+event.clientY);


//put here your div's code
}

Hope this be of help. Greetings


Don't give up!!
http://webstationone.com/test/htmlarea


(This post was edited by Luis on Dec 30, 2004, 4:01 PM)


Joshua
Novice

Jan 3, 2005, 1:34 AM

Post #4 of 4 (5308 views)
Shortcut
Re: [Luis] Button coordinate [In reply to] Can't Post

Thanks! Smile

 
 
 


Search for (options)