Solved

window.status in CSS?

Posted on 2006-07-15
5
711 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
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 the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 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