473,725 Members | 2,276 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 3267
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
4723
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
4299
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
12697
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
2276
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
3444
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
1015
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
1556
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
2269
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
4221
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
17203
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
9401
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
9257
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
9179
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
9116
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8099
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...
1
6702
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
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.