Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > making part of a background image clickable

Reply
Thread Tools

making part of a background image clickable

 
 
laredotornado@zipmail.com
Guest
Posts: n/a
 
      05-09-2007
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

 
Reply With Quote
 
 
 
 
ASM
Guest
Posts: n/a
 
      05-09-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
 
 
 
laredotornado@zipmail.com
Guest
Posts: n/a
 
      05-09-2007
On May 9, 2:00 pm, ASM <(E-Mail Removed)>
wrote:
> (E-Mail Removed) 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making GridView results clickable. Mike ASP .Net 0 08-24-2009 09:12 PM
Make background clickable Kristian Javascript 1 01-05-2007 02:53 PM
PNG image - transparent part clickable in Firefox Martin HTML 15 07-21-2005 01:44 PM
Making a TableCell Appear Clickable Nathan Sokalski ASP .Net 1 05-16-2005 08:16 AM
Making form labels clickable Nick Howes HTML 5 05-03-2004 11:36 AM



Advertisments