I am working on a project for grad school that has me creating a webpage that needs to have a small javascript element that I'm having a lot of trouble with.
I need to make a link in Javascript that lets the user hover over the link, and when the mouse is over it, the color changes from blue (the regular) to white, but when the text is rolled over, it needs to have a dark green highlight.
So I need to go from a regular blue hyperlink with no highlight to a white texted green highlighted hyperlink, using Javascript.
Hopefully someone out there can help, there is nothing in my textbook about it. I've been using these two resources from the internet, but cannot get it to work.
http://www.javascriptkit.com/script/script2/highlight.shtml
http://www.rgagnon.com/jsdetails/js-0055.html
Each do something that I need to do, but neiter do both at the same time and I'm trying to put them together but they do not work.
8 1776
hi blaze,
I need to make a link in Javascript that lets the user hover over the link, and when the mouse is over it, the color changes from blue (the regular) to white,
your start of the statement confuses with the ending part
but when the text is rolled over, it needs to have a dark green highlight.
what do you want that when the text is rolled over the color changes from blue to white or dark green and where is your code that you have written please paste it here
regards
,
Omer Aslam
What I need to have is
FIRST (with no rollover)
Blue text (like a regular hyperlink
SECOND (when the mouse is over)
White Text with a green highlight
Sorry, I was having trouble formulating it into a paragraph. Haha, hopefully this will help.
text with a green HIGHLIGHT , where do you got such an assignment , :d may be some thing else you want to say but not finding the right words , making text color change on hover does not require any javascript , you can have this working trough a css hover class butt adding hightlight / shadow are different and never cross browser , but you need to look to jquery for that , i seriously never heard of the term highlighting the text
I know, I am adept in CSS, and would LOVE if they would let me use CSS. This professor is crazy. He wants a green highlight on rollover, and white text to go with that green highlight. It's just odd, and I've been looking all over the internet and I'm only finding bits and pieces, and I cannot figure out how to put them together.
i cant figure out the HIGHLIGHT blazewalker :D , i just cant get the concept that how the text is going to be hightlighted , changing color makes sense but what kind of effect is highlight , i cant get it
regards,
Omer Aslam
By highlight, he means change the background color of the text.
By highlight, he means change the background color of the text.
if this is what you mean blazewalker try this -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
<title>Untitled Document</title>
-
</head>
-
<style type="text/css">
-
a{
-
display:block;
-
}
-
</style>
-
<script type="text/javascript">
-
function changeColor(eleObj,status){
-
if(status){
-
eleObj.style.backgroundColor='green';
-
eleObj.style.color='white';
-
}else{
-
eleObj.style.backgroundColor='white';
-
eleObj.style.color='blue';
-
}
-
}
-
</script>
-
<body>
-
<div>
-
<a href="#." onmouseover="changeColor(this,1);" onmouseout="changeColor(this,0)">This is a link</a>
-
</div>
-
</body>
-
</html>
-
regards,
Omer Aslam
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Matt Adams |
last post by:
As well known I could specify the text color in the body tag like:
<BODY TEXT=WHITE LINK=WHITE VLINK=RED ALINK=WHITE>
What I want to achieve now is that always (!) the text of the last visited...
|
by: Alpha |
last post by:
Hello. I am not a C++ programmer...I have studied a bit of Java, but
that's it.
However, I am playing an online game written in C++. I was wondering
how one could change the color of text (that...
|
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...
|
by: Chris Stanley |
last post by:
I am using dreamweaver to make an ASP page. I have a table of data
from a MSSQL database that is currently showing on the ASP page. I
want the ability to change the color based on a priority...
|
by: ASP Yaboh |
last post by:
I have a Repeater control bound to a DataSet that creates a table with 6
columns. The text displayed in one of the columns may need to be set to grey
instead of black.
The DataSet is held and...
|
by: Amy |
last post by:
<style>
div.helpBtn{ font:bold 73% verdana; color:#995F8D; text-align:left;
width:79px; height:24px; margin:0px; padding: 5px 0px 0px 27px;
background:...
|
by: tsahiasher |
last post by:
hi,
i'm trying to use the RichTextBoxSelectionColor property, but in any
combination of command order i try, the text color is not changed. the
only time it worked was when i set SelectionStart =...
|
by: cpbsmw |
last post by:
I need to write a code that causes the background color and text color of a control when its value changes. for example if the word in the control is Afghanistan i need the background color to be...
|
by: sbaker8688 |
last post by:
My God, how on earth do you use javacript to change the text color of
an input element, and have it work with IE??? I've tried numerous
solutions. All of them work on browsers such as Mozilla. ...
|
by: =?Utf-8?B?bGpsZXZlbmQy?= |
last post by:
I want to specify a custom color for disabled text that is used by a class
that inherits from ToolStripProfessionalRenderer. The code would look
something like this:
Public Class MyRenderer...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |