Solved

window.status in CSS?

Posted on 2006-07-15
5
700 Views
Last Modified: 2013-11-19
This is a far fetched question...

<a href="" class="cs">I am a link</a>

Is there a way to make every link with a class of "cs" on my page have a window.status of "click to view"?  Ideally it would be...

A.cs {
      window-status:'click to view';
}

That I know of this is not possible.  If not, what might be an alternative way of doing this without modifying the actual link tag?  I'm thinking JavaScript after the page loads to loop through the page, grab all elements that are "cs", and then modify their properties from that...   ??   Any other ways maybe?
0
Comment
Question by:rebies
  • 3
  • 2
5 Comments
 
LVL 26

Accepted Solution

by:
DireOrbAnt earned 500 total points
ID: 17115488
No, I don't believe you can do that.
An alternative would be using JavaScript with something like:
<HTML>
<HEAD>
<SCRIPT TYPE="text/javascript">
function SetStatusBar(ClassToSet, Msg) {
  var ToSet = document.getElementsByTagName('A');
  for(var i=0; i < ToSet.length; i++){
    if (ToSet[i].className && ToSet[i].className == ClassToSet) {
      ToSet[i].onmouseover = function() { window.status=Msg; return true; };
      ToSet[i].onmouseout = function() { window.status=''; };
    }
  }
}
</SCRIPT>
</HEAD>
<BODY onload="SetStatusBar('WStatus', 'click to view')">
<A HREF="javascript:;" CLASS="WStatus">Change Status</A><BR>
<A HREF="javascript:;">Don't change Status</A><BR>
<A HREF="javascript:;" CLASS="WStatus">Change Status Again</A><BR>
</BODY>
</HTML>
0
 
LVL 26

Expert Comment

by:DireOrbAnt
ID: 17115496
Keep in mind that Firefox has an option to disable status bar changes through scripting and I believe it's disabled by default.
IE7 will do the same, I don't know what the default will be though.
0
 
LVL 1

Author Comment

by:rebies
ID: 17116083
DireOrbAnt:

Sorry for the late reply!  Wow - thats really cool and what I was hoping to do!  Thanks.   I was doing it a similar, more difficult way...  I did not quite complete it, but in Psudo JS..

For All "A" elements
   element.outerHTML = element.outerHTML (with OnMouseOver="...") written in just before the first ">"

But the way you do it works much better!  Thus, I don't have to rewrite the HTML on the page at all!

Thanks for the hlep!
0
 
LVL 1

Author Comment

by:rebies
ID: 17116087
By the way.  EE should have an "A++" feature - where they only encourage you to do that if the answer is amazingly perfect.  Looking at this - it's exactly what I was having difficulty with!  Thanks again for the help!  Now I don't have to re-write 1,000 random link tags!

Andrew
0
 
LVL 26

Expert Comment

by:DireOrbAnt
ID: 17116335
>>EE should have an "A++" feature
I appreciate that and I'm happy you saved some time :)
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question