Jump to content

Retrieving style properties from a target div


Recommended Posts

I have a page that displays a number of divs that a user can drag and drop, and resize. The style properties of these divs are stored in a database. What I would like is to right click on a div and pop up a menu where one can edit the style properties such as border, background, etc… My two main problems right now are preventing the browser’s right click menu from displaying, and trying to figure out how to retrieve the properties from the target div.Anyone have any ideas?Thanks

Link to post
Share on other sites

Preventing a right-click is dicey but there are a variety of snippets out there that will work providing the user has javascript turned on:<body oncontextmenu="return false;"> This one works in many situations but I think Opera ignores it. YMMV. As a recent adopter of jQuery I'd suggest that it may be worth looking into for retrieving object properties. It can get properties fairly easily, including dynamically altered properties. It's worth a shot.

I have a page that displays a number of divs that a user can drag and drop, and resize. The style properties of these divs are stored in a database. What I would like is to right click on a div and pop up a menu where one can edit the style properties such as border, background, etc… My two main problems right now are preventing the browser’s right click menu from displaying, and trying to figure out how to retrieve the properties from the target div.Anyone have any ideas?Thanks
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...