473,416 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

mouseover change image and text color.

Amy
<style>
div.helpBtn{ font:bold 73% verdana; color:#995F8D; text-align:left;
width:79px; height:24px; margin:0px; padding: 5px 0px 0px 27px;
background: url(/jsp/images/pms/housekeeping/helpBtn_off.gif)
no-repeat; }
div.helpBtnOn{ font:bold 73% verdana; color:#BB59DE; text-align:left;
width:79px; height:24px; margin:0px; padding: 5px 0px 0px 27px;
background: url(/jsp/images/pms/housekeeping/helpBtn_on.gif)
no-repeat; cursor:pointer; }
</style>

<div class="helpBtn" onmouseOver="this.className='helpBtnOn'"
onmouseOut="this.className='helpBtn'" onClick="popWin()">HELP</div>
This is the code I have for an image and text. They appear as such that
the HELP word is on top on the image. Notice the image is set as
background in the div.

On mouseover, the image changes as well as the text color. On mouseout,
return to original image and text color. The problem is, this does not
always work well. Sometimes the image 'disappear' when mouseover,
leaving only text.

I wonder, if there is a better way of doing this?

Appreciate any thoughts.

May 19 '06 #1
2 3989
Amy wrote:
<style>
div.helpBtn{ font:bold 73% verdana; color:#995F8D; text-align:left;
width:79px; height:24px; margin:0px; padding: 5px 0px 0px 27px;
background: url(/jsp/images/pms/housekeeping/helpBtn_off.gif)
no-repeat; }
div.helpBtnOn{ font:bold 73% verdana; color:#BB59DE; text-align:left;
width:79px; height:24px; margin:0px; padding: 5px 0px 0px 27px;
background: url(/jsp/images/pms/housekeeping/helpBtn_on.gif)
no-repeat; cursor:pointer; }
</style>

<div class="helpBtn" onmouseOver="this.className='helpBtnOn'"
onmouseOut="this.className='helpBtn'" onClick="popWin()">HELP</div>
This is the code I have for an image and text. They appear as such that
the HELP word is on top on the image. Notice the image is set as
background in the div.

On mouseover, the image changes as well as the text color. On mouseout,
return to original image and text color. The problem is, this does not
always work well. Sometimes the image 'disappear' when mouseover,
leaving only text.

I wonder, if there is a better way of doing this?


You could try the css "hover" pseudo class and the internet explorer
workarounds that go with it. Google "pure css menu" to get started.

....but the javascript should work. It works fine for me in Firefox
1.5.0.3 and Safari 1.3. When doesn't it work?

Peter

May 20 '06 #2
Amy
It does work. . but the result is not very consistent. As I mentioned,
the image tend to 'disappear' for a while when mouseover. Some other
time it works just fine.

May 20 '06 #3

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

Similar topics

1
by: Margaret Asami | last post by:
I have 2 frames, one frame is a table of content with a bunch of links, and the other frame houses the contents. I want to be able to change the color of the link text when the user clicks on it. ...
5
by: AFN | last post by:
I'm trying to set a submit button to change text and color when clicked. Like saying "please wait" instead of "submit" and then changing the background color and text color. All works, except for...
0
by: Steven | last post by:
Hi, I have a toolbar control with several buttons in ToolBarButton class. How can I change the text color of the ToolBarButton control in VB.NET 2003? Thanks! Steven
1
by: Mohanapriya | last post by:
Hi, Is there a way to Open the excel in a specified path and modify the color of certain words/characters and save it the same path.
0
by: khanh | last post by:
I know how to highlight a treenode when the mouse is moving over it in a drag and drop, but what I would like to do is change the forecolor of a node and change it back when the mouse is moved away...
0
by: spacecadet563 | last post by:
I am trying to change and display the image source of an image control (named image2 )on mouseover of cell event on a gridview(Gridview1) with a SQL datasource. The cell contains image name of image...
8
by: ismailc | last post by:
Hi, I would like to change the text color of (<xsl:value-of select="Description") onmouseover of image. the javascript works, it's just that i can seem to get the name correct <td>...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.