473,662 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

May 9 '07 #1
2 1885
ASM
la***********@z ipmail.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
May 9 '07 #2
On May 9, 2:00 pm, ASM <stephanemoriau x.NoAd...@wanad oo.fr.invalid>
wrote:
laredotorn...@z ipmail.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

May 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5386
by: Aaron | last post by:
I know this is a thing used primarily on websites..but since python can do anything ;) I'm trying to make a clickable image map for my wxPython program. Basically, I know how to organize the images into one large image in a panel, but how do I make the individual pieces clickable like webpage links(in wxPython)? The goal is to add an event handler that displays the image piece in a different panel, along with attributes. Which I could do...
14
35548
by: Jeff Gillingham | last post by:
I'm using a stylesheet to place a small 'background image' in the upper left corner of several pages. Is there a simple way of making that image a clickable link? Thanks.
3
2044
by: inonzuk | last post by:
Hi everyone, I'm new to javascript and have the following problem: I have two image buttons: 1) <td><a href="http://localhost/gamerules.php" target="mainwindow"><img onMouseOver="return changeRules()" onMouseOut="return changeRulesBack()" name="b_rules" src="images/b_rules.jpg" width=130 height=90></a></td> 2)
4
3748
by: steven | last post by:
Hi, I have a header which consists of an image with clickable areas. Now since this header appears on all my pages it would make sense to put it as a background-image in my CSS. However, I can't see how I can put the image maps in the CSS. (I guess it can't be done because backgrounds are backgrounds and should not have active areas?)
4
3628
by: Gary | last post by:
Hello, I want a background image to display in the extreme bottom right corner. What I have works fine in IE7 and FF2 not so in Opera 9.1 Any suggestions? Page Posted at the the link. http://7ref.com/qzw
4
3456
by: ShieldsJared | last post by:
Im looking for help making a good GUI out of pure images. I would like to embed the common controls and such, but I want to make a nice looking GUI, similar to that of, say Windows Media Player. I'm not sure how to make an image "clickable", nor do I know how to make rollovers and such. Also looking for pointers on making the images blend well when sitting on top of each other. Any ideas? Thanks for your input!
3
5555
by: crazychrisy54 | last post by:
Hi there I just wondered if there is any way using GD to insert a clickable button or some clickable text into a image? It is possible to create images for buttons but what if you want a clickable button *inside* another image. I don't know if this is along the right lines but the following code puts a image inside another image. Perhaps I could then make im2 clickable or is it just not possible? Any help would be very much
4
14642
by: GArlington | last post by:
I am trying to implement an image map (in this particular case a country map) with few <area ...>s on it. The challenge is to add background image (dot) to each <areaso it will display over the image map. I am failing miserably at that. Anybody tried to do that before? Anybody succeeded?
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.