?
Solved

window.status in CSS?

Posted on 2006-07-15
5
Medium Priority
?
734 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
[X]
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
  • 3
  • 2
5 Comments
 
LVL 26

Accepted Solution

by:
DireOrbAnt earned 2000 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

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

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

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…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

741 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