Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

including status javascript in a CSS

Status
Not open for further replies.

jakeyg

Programmer
Mar 2, 2005
517
GB
I'm trying to set the value in the status bar to hide the path. I know I can do it by putting
<A HREF=" ONMOUSEOVER="window.status='hello';return true;">

Is there a way to include this in my stylesheet instead of having to find every <A HREF and adding it manually
like
a{
color:#006699;
font-weight:bold;
status:"Hello";
}

or is there some really easy alternative way i've overlooked

thanks
 
JavaScript and CSS are totally different beasts altogether. There's no way you could do that. You could include a JS script at the top which would loop through all <a> elements and include your command. One question remains though -- why would you want to do that. Sites that hide their link values in status bar don't see me for a long time.
 

To add to Vragabond's post, Firefox, after an out-of-the-box install, disables the update of the status bar, to stop spoofing attacks, etc.

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
I want to do it because the boss said that's what he wants :) the usual sad tale

my initial idea was a bit of duck tape stuck to the bottom of the screen. Hey presto, instant blanking

thanks guys
 
Nah, duct tape costs $$.
Tell boss to hit F11. [pipe].

------
heisenbug: A bug that disappears or alters its behavior when one attempts to probe or isolate it
schroedinbug: A bug that doesn't appear until someone reads source code and realizes it never should have worked, at which point the program promptly stops working for everybody until fixed.

[ba
 
hmm, that reminds me
if you're ever playing an online game and the server is full of buffoons, tell one of your team to turn the auto-aiming on using Ctrl-F4

watch as the server clears up nicely B-)
 
Or tell wannabe hacker to nuke someone at 127.0.0.1 :E
Btw. you may try this:
Code:
<style type="text/css">
a:hover
{	display: expression(foo());
}
</style>
<script language="javascript">
function foo()
{	window.status = "Hey boss :P";
	return "inline";
}
</script>
IE only, makes things run slower and... did I say I don't like it?

------
heisenbug: A bug that disappears or alters its behavior when one attempts to probe or isolate it
schroedinbug: A bug that doesn't appear until someone reads source code and realizes it never should have worked, at which point the program promptly stops working for everybody until fixed.

[ba
 
Actually I think you can put javascript in CSS. Whether it would solve this problem or not I don't know.

I noticed that someone with a complex css layout, who posted it here recently, used the technique but I can't remember the thread.

I also read about it somewhere on the web.

Clive
 
I can't recall where I first saw this code, but it saves having to add onmouseovers to each of the <a> tags.
Code:
[COLOR=grey]
<!-- HTML code
<script type="text/javascript" src="statusbar.js"> </script>
-->
[/color]
[COLOR=green]/* statusbar.js */[/color]
window.onload = parseATags;

function parseATags() {
  aTags = document.getElementsByTagName('a');
  for (i=0; i<=aTags.Length; i++) {
    aTags[i].onMouseOver = setStatus;
  }
}

function setStatus() {
  window.status = '';
  return true;
}

That said, please don't play with the status bar! OK, you won't annoy me, because statusbar changing is disabled in my browser, but you'll p*** off a lot of punters.

<marc>
 
hanks guys, the boss has meandered off and forgotten all about it now, after hours spent trying to get it to work. Same ol' same ol' [sad]

BTW why does everyone hate the idea of hiding the link values in status bar so much? Security, so you're not being redirected to dodgy sites?
 

IMO, that's the main reason, yes

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top