change properties of dragged object

Discussion in 'Javascript' started by Andy, Sep 8, 2004.

  1. Andy

    Andy Guest

    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
     
    Andy, Sep 8, 2004
    #1
    1. Advertising

  2. 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 = '...';"
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Sep 8, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bora Eryilmaz
    Replies:
    1
    Views:
    352
    Victor Bazarov
    Apr 18, 2005
  2. Mathematician
    Replies:
    0
    Views:
    570
    Mathematician
    Dec 24, 2006
  3. SuperZE
    Replies:
    5
    Views:
    348
    SuperZE
    Oct 6, 2008
  4. SpencerW
    Replies:
    5
    Views:
    249
    Steven Cheng[MSFT]
    May 27, 2005
  5. Replies:
    1
    Views:
    130
    Joshie Surber
    Nov 19, 2005
Loading...

Share This Page