Cross-Browser.com

X Library Forums

You are not logged in.

  • Index
  •  » X Applications
  •  » How to create a toolbar that pops up relative to the selected element

#1 January 9, 2008 5:16:01 pm

cindiv30
New Member
Registered: January 9, 2008
Posts: 3

How to create a toolbar that pops up relative to the selected element

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

 

#2 January 9, 2008 9:02:50 pm

Excalibur
New Member
Registered: December 12, 2007
Posts: 5

Re: How to create a toolbar that pops up relative to the selected element

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

 

#3 January 10, 2008 12:35:56 pm

cindiv30
New Member
Registered: January 9, 2008
Posts: 3

Re: How to create a toolbar that pops up relative to the selected element

Thank you! I will try that and let you know how it goes...

Cindi

Offline

 

#4 January 21, 2008 10:24:59 pm

Excalibur
New Member
Registered: December 12, 2007
Posts: 5

Re: How to create a toolbar that pops up relative to the selected element

How did this turn out for you, Cindi?

Offline

 

#5 January 22, 2008 9:12:14 am

cindiv30
New Member
Registered: January 9, 2008
Posts: 3

Re: How to create a toolbar that pops up relative to the selected element

Hi - this definitely worked! Thanks for the help!!

Offline

 
  • Index
  •  » X Applications
  •  » How to create a toolbar that pops up relative to the selected element

Board footer

Powered by PunBB 1.2.15
Copyright © 2002–2005 Rickard Andersson

Expand Restore Select Format Eval Load