Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom Allen 50 posts 71 karma points
    Feb 21, 2012 @ 16:55
    Tom Allen
    0

    Custom datatype - get clicked image co-ords - how?

    Having never built a custom datatype before, I need to create something to save the co-ordinates of a mouse click on a static image. The image will always be the same. I just need to get the x/y pixel co-ordinates that are clicked. It could be as simple as having the image displayed, a textbox beneath, and a javascript routine to insert the values x,y into the textbox, the contents of which are then saved.

    What would be the simplest way of achieving this?

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Feb 21, 2012 @ 17:31
    Lee Kelleher
    0

    Hi Tom,

    Given this will be your first custom data-type, initial advice is small steps - and be free to ask any questions!

    Tim Geyssens has a good presentation called "Master of DataTypes" ... with a follow-up blog post on "UserControlWrapper and storing parseable xml data". (This depends on whether you'd like to store the data/value as XML or comma-separated?)

    With the editor UI, see what others have done for this ... a quick Google search (for "jquery image co-ordinates") found this: getting the X/Y coordinates of a mouse click on an image with jQuery, demo here.

    Cheers, Lee.

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Jul 05, 2013 @ 12:13
    Lee Kelleher
    0

    Hi Tom,

    Curious, did you ever get a solution for this? As funnily enough, I need the similar functionality on my current project.

    Thanks, Lee.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies