Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

window.status in CSS?

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Capture logon name 13 87
Only three borders showing on image 5 28
Width of Page is Affecting Side Menu 6 31
Fix Form size HTML 16 13
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

860 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