473,698 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3263
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="setAllH refOver(returnF alse);">:
<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*****@agrico reunited.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
4720
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" onMouseOver="window.status=this.title" onMouseOut="window.status=''">Micky Mouse</A> </td>
3
4297
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, but they load very very fast, within 2-3 seconds. i tried several things such as :
18
12688
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 state, the HTML page URL would change from default.html to default.html#stateA. example: http://pearstudios.com/javascript/locationHashAndFlash.html This has worked perfectly within HTML and javascript alone, however, when connecting Flash and...
8
2269
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; In the right column I have a javascript link which hides the column. This is very necessary due to the width of content shown on the site at times. Clicking the link makes the scrollbars appear for no aparent reason - both horizontal by about...
9
3440
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 know if it's the Javascript or the PHP that is causing the problem. I started with an example in a book and added on. The script I'm using is: <SCRIPT LANGUAGE="Javascript" TYPE="text/javascript"> <!--
0
1011
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 onmouseover="window.status='text';" and onmouseover="window.defaultStatus='text';" but both do not work. it still shows the e.g. text above.
1
1551
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 onmouseover="window.status='text';" and onmouseover="window.defaultStatus='text';" but both do not work. it still shows the e.g. text above.
5
2268
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 this out. So far I have come up with the following: <script language="JavaScript" type="text/javascript"> var WindowObjectReference; // global variable
3
4214
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - I have window.status="Moomin"; why doesn't the statusbar change? ----------------------------------------------------------------------- When changing the status in an event (e.g. onmouseover) you should return true from the event. Also a number of browsers require a short delay before setting the status to overcome their default behaviour with the...
5
17195
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
8674
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
9027
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
8895
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
7725
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
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
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.