Place image upon mouse click

Discussion in 'Computer Games and General Discussion' started by soulx, Sep 6, 2011.

Sep 6, 2011

Place image upon mouse click by soulx at 11:46 PM (422 Views / 0 Likes) 2 replies

  1. soulx
    OP

    Member soulx GBAtemp Legend

    Joined:
    Apr 4, 2009
    Messages:
    10,130
    Country:
    Canada
    Does anyone know how I would make an image be placed automatically upon a mouse click (using Javascript)?

    As in, a users mouse click would place a pre-defined image (i.e, user clicks right side of page, image is placed there).

    Thanks! [​IMG]
     
  2. soulx
    OP

    Member soulx GBAtemp Legend

    Joined:
    Apr 4, 2009
    Messages:
    10,130
    Country:
    Canada
    Bump.
    Before you start bitching about this bump, note that I got permission from ProtoKun7..
     
  3. soulx
    OP

    Member soulx GBAtemp Legend

    Joined:
    Apr 4, 2009
    Messages:
    10,130
    Country:
    Canada
    Thanks to some awesome guy at Stack Overflow, I got some assistance with the script. Now I need some help adding a .click() handler. The code I got so far is,
    CODE
    ÂÂ
    ÂÂÂÂ
    ÂÂÂÂ
    ÂÂÂÂ

    ÂÂ

    ÂÂ
    [​IMG].click()
    ÂÂ

    The thing is that I don't know how to add a .click() handler to an image. I want it so that if the image is clicked, it'll perform the event mentioned in the script, which is to place an image.

    And if you guys can't help with this one, I'll just go back to stackoverflow. :X

    Edit:
    Lovely, ain't it?
    http://stackoverflow.com/questions/7374562...ent-to-an-image
     

Share This Page