Reputation: 165
There are lots of pages that tell me how to drag a shape or image across a canvas, even drag text. However, I want to drag texts in the form of clickable HTML URLs (hyperlinks), i.e., to group several on the one canvas to give an impression of relevancy (the closer the links to each other, the more closely they are related. (being HTML links, only their titles will be visible - the actual URLs will be hidden).
The first problem that arises is whether I can use a single left-click to either activate the link (take me to another page) or have it interpreted as the beginning of a drag. Probably I will have to use a different hotkey, such as a r-click to drag, a l-click to activate. I don't want to have to double-click to activate - an extra click becomes tedious.
I haven't found anything that specifically addresses this problem, either in this forum or elsewhere, so would be grateful for suggestions as to how to go about implementing this form of drag-and-drop. Thanks.
Upvotes: 0
Views: 267
Reputation: 9465
Moving your link will essentially be the same as moving an image. Canvas has no URL componentant or tag element - you'd have to create your own.
So you're pretty much just going to create a button with an onclick event that will call the URL associated with that button.
Upvotes: 1