Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   making part of a background image clickable (http://www.velocityreviews.com/forums/t931127-making-part-of-a-background-image-clickable.html)

laredotornado@zipmail.com 05-09-2007 05:19 PM

making part of a background image clickable
 
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


ASM 05-09-2007 07:00 PM

Re: making part of a background image clickable
 
laredotornado@zipmail.com 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

laredotornado@zipmail.com 05-09-2007 07:46 PM

Re: making part of a background image clickable
 
On May 9, 2:00 pm, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
> laredotorn...@zipmail.com 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



All times are GMT. The time now is 06:27 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57