making part of a background image clickable

Discussion in 'Javascript' started by laredotornado@zipmail.com, May 9, 2007.

  1. Guest

    Hi,

    Let's say I have a background image for a table cell. It doesn't
    repeat and is right-aligned.

    ..cellBG {
    background: url('../images/mygf.gif') no-repeat;
    background-position: right;
    }

    How would I trigger a particular event if a user clickx on the right-
    most 50 pixels of the cell (and hence the image that's behind it)?

    Thanks, - Dave
     
    , May 9, 2007
    #1
    1. Advertising

  2. ASM Guest

    a écrit :
    > Hi,
    >
    > Let's say I have a background image for a table cell. It doesn't
    > repeat and is right-aligned.
    >
    > .cellBG {
    > background: url('../images/mygf.gif') no-repeat;
    > background-position: right;
    > }
    >
    > How would I trigger a particular event if a user clickx on the right-
    > most 50 pixels of the cell (and hence the image that's behind it)?


    and what about to simply click the TD ?
    (or have you something else to click in it ?)

    --
    Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    Stephane Moriaux and his (less) old Mac already out of date
     
    ASM, May 9, 2007
    #2
    1. Advertising

  3. Guest

    On May 9, 2:00 pm, ASM <>
    wrote:
    > a écrit :
    >
    > > Hi,

    >
    > > Let's say I have a background image for a table cell. It doesn't
    > > repeat and is right-aligned.

    >
    > > .cellBG {
    > > background: url('../images/mygf.gif') no-repeat;
    > > background-position: right;
    > > }

    >
    > > How would I trigger a particular event if a user clickx on the right-
    > > most 50 pixels of the cell (and hence the image that's behind it)?

    >
    > and what about to simply click the TD ?
    > (or have you something else to click in it ?)
    >
    > --
    > Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    > Stephane Moriaux and his (less) old Mac already out of date



    To answer your question, yes, there is something else to click in it.
    However, if I could catch the TD.onclick event and then determine
    relative x,y coordinates of where the mouse click occurred, I could do
    what I want.

    - Dave
     
    , May 9, 2007
    #3
    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. Nathan Sokalski

    Making a TableCell Appear Clickable

    Nathan Sokalski, May 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    496
    Eliyahu Goldin
    May 16, 2005
  2. Nick Howes

    Making form labels clickable

    Nick Howes, Apr 29, 2004, in forum: HTML
    Replies:
    5
    Views:
    2,289
    Toby A Inkster
    May 3, 2004
  3. Martin
    Replies:
    15
    Views:
    2,544
    Steve Pugh
    Jul 21, 2005
  4. Mike
    Replies:
    0
    Views:
    332
  5. Kristian

    Make background clickable

    Kristian, Jan 5, 2007, in forum: Javascript
    Replies:
    1
    Views:
    121
    Kristian
    Jan 5, 2007
Loading...

Share This Page