473,398 Members | 2,120 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,398 software developers and data experts.

add window.status javascript to a:hover css pseudo-class?

Hi, basically what I'd like to do is suppress the action that causes
the URL to show up in the browser status bar when I roll over a
hyperlink. I know I could use the onmouseover event in each anchor
tag, but I'd rather be able to do it globally thru my stylesheet,
rather than having to futz with each link. Does anyone know a
solution for this? It seems like you could maybe add quick
window.status='blah' javascript or something to the a:hover
pseudoclass to control status bar behavior. Thanks.
Jul 23 '05 #1
2 3242
Bob P. wrote:
Hi, basically what I'd like to do is suppress the action that causes
the URL to show up in the browser status bar when I roll over a
hyperlink. [...]


No, you don't want to mess with the UA of your visitors.
PointedEars
Jul 23 '05 #2
"Bob P." wrote:
Hi, basically what I'd like to do is suppress the action that causes
the URL to show up in the browser status bar when I roll over a
hyperlink. I know I could use the onmouseover event in each anchor
tag, but I'd rather be able to do it globally thru my stylesheet,
rather than having to futz with each link. Does anyone know a
solution for this? It seems like you could maybe add quick
window.status='blah' javascript or something to the a:hover
pseudoclass to control status bar behavior. Thanks.


No, you can't add Javascript to CSS, at least not in a cross-browser,
cross-platform way (I think IE supports "behaviours" in CSS, but it's
not supported in most other browsers).

Use the following code to set the onmouseover event for every <A> on the
page:

<body onload="setAllHrefOver(returnFalse);">:
<script type="text/javascript">
function returnFalse() { return false; }
function setAllHrefMOver(f, d, inLayer) {
// to minimize page size, rather then defining separate onmouseover
// events for every link on the page, any link without an existing
// onmouseover event is set by this function

if (!inLayer) {
d = document;
}

if (d) {

var i;

if (d.links) {
for (i = 0; i < d.links.length; i++) {
if (!d.links[i].onmouseover) {
d.links[i].onmouseover = f;
}
}
}

if (d.layers) {
for (i = 0; i < d.layers.length; i++) {
setAllHrefMOver(f, d.layers[i].document, true);
}
}
}
} // setAllHrefMOver()
</script>

It just occurred to me you could use the "d" parameter to determine if
you're in a layer or not, you don't really need the "inLayer" indicator.
I'm not sure why I did that way, I think I wanted to be explicit about
when the function has been called recursively.

Note also that this function could be modified to either be passed the
event, or you could make a copy of the function for the onmouseout or
other events. You can also use it to assign events to other elements at
run-time. If you want to use it for elements other then <A>, you'll want
to investigate whether recursing into layers is required.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #3

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

Similar topics

8
by: mark4asp | last post by:
Why won't the window.status message change ? IE ver. 6.0.2800.1106 displays the tooltip OK. <td> <A HREF="editAuthor.asp?item=4" title="Edit author details"...
3
by: Mehmet Gunacti | last post by:
Hello, on our homepage, when pressing an anchor tag, a special sized popup window opens via javascript. but it opens very slowly. on other web pages, there are also javascript-opened windows,...
18
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
8
by: Andrew Phillipo | last post by:
I have a layout which works perfectly. It is three column, the central column is width:auto; with margins and the columns are absolutely positioned at top:0px; left:0px; and top:0px;right:0px; ...
9
by: gleverett | last post by:
I have been searching the 'Net, and I can't find the right solution here. I am writing some PHP pages that utilize some Javascript. The script works in Mozilla/Netscape, but fails in IE. I don't...
0
by: Jason | last post by:
Hi when you hover over a LinkButton, the window status text changes. e.g. javascript:__doPostBack('lnkNextBottom','') how do i change it so that it does not display this text? i have tried...
1
by: Jason | last post by:
Hi when you hover over a LinkButton, the window status text changes. e.g. javascript:__doPostBack('lnkNextBottom','') how do i change it so that it does not display this text? i have tried...
5
by: JNariss | last post by:
Hello, Within a form I created I have placed links that users can click on to view information. I am trying to write a javascript code so it opens in a sized window but I can't seem to figure...
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - I have window.status="Moomin"; why doesn't the statusbar change?...
5
by: GS | last post by:
Guys: I have a question, Is it possible to implement pop-up window without Java script, we don't want to use java script since it might get blocked by pop-up blocker. Thanks in advance. GS.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
tracyyun
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 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.