change properties of dragged object

A

Andy

Hi,

I wonder if it's possible to change the properties of an object while
dragging it.

On a webpage I have icons provided with links... I'd like to prevent
dragging the icons on the desktop and opening the link from there so I
implemented the ondragstart attribute in the link (only IE).

It's of course no problem then to call any function if the event fires
(e.g. showing an alert message) but rather than that I'd like to
change the href property of the link to point to another address.

I tried ondragstart=document.getElementById('<mylinkID>').href='<newurl>'
but this didn't work...

Any ideas?

Thank you,
Andy
 
M

Martin Honnen

Andy wrote:

I wonder if it's possible to change the properties of an object while
dragging it.

On a webpage I have icons provided with links... I'd like to prevent
dragging the icons on the desktop and opening the link from there so I
implemented the ondragstart attribute in the link (only IE).

It's of course no problem then to call any function if the event fires
(e.g. showing an alert message) but rather than that I'd like to
change the href property of the link to point to another address.

<a ondragstart="this.href = '...';"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top