X Library Forums
You are not logged in.
Pages: 1
Hi all - I'm trying to allow users to add text/image elements to a page and then after that element has been added, and then to allow the user to click on the object to select it, display a toolbar right above the element with links/buttons for common commans (copy element, delete, move forwards, move backwards, edit). The trick is that I need this toolbar to display on top of the selected element and for the toolbar to move with the element while the user drags the element around on the screen. I also need to allow them to resize the element in some way (maybe a bottom toolbar strip with the resize icon in the bottom right). Can anyone help with the approach to doing this??! I would be very appreciative!!
Thanks!
Cindi
Offline
The element you want the toolbar to appear above needs to have an ID associated with it. Then, use the xPosition stuff to move your toolbar to wherever you want. I would look at something that gave a computed style for a specific element. Here's where you can use the xLibrary to get the computed style: http://www.cross-browser.com/x/lib/view.php?s=xGetComputedStyle
Look for the left and top of the relative element and set your toolbar's properties appropriately.
Actually, with this edit, I suggest you create a function that does all of this and pass the element in. Then you won't have to worry about an id for stuff. someFunction(this); would be the call in the onMouseOver portion of the element.
Last edited by Excalibur (January 9, 2008 9:06:52 pm)
Offline
Thank you! I will try that and let you know how it goes...
Cindi
Offline
How did this turn out for you, Cindi?
Offline
Hi - this definitely worked! Thanks for the help!!
Offline
Pages: 1