Jump to content

Recommended Posts

The easiest way of explaining this is probably with a link. Check out the list of games under the pie chart at this page. Work in progress.

 

So, my rows are clickable and provide visual feedback as you mouseover, which is what I wanted. It does this with:

 

<script type="text/javascript">
    function ChangeColor(tableRow, highLight)
    {
    if (highLight)
    {
      tableRow.style.backgroundColor = '#666666';
    }
    else
    {
      tableRow.style.backgroundColor = '#333333';
    }
  }

  function DoNav(theUrl)
  {
  document.location.href = theUrl;
  }
</script>

 

and

 

<tr onmouseover="ChangeColor(this, true);this.style.cursor='pointer';window.status='http://www.url.tld'; return true"
onmouseout="ChangeColor(this, false);"onclick="DoNav('../some/url/');">

 

I have just one problem with all of that, which might be trivial to some but for me ruins the pie. window.status does not work in Firefox (or with later versions of IE (boo hoo)), so the behaviour isn't consistent with normal links. And I prefer to avoid JavaScript.

 

Can this be done purely with CSS? With a properly updating status bar?

 

Offer cookies!

Link to comment
https://forums.phpfreaks.com/topic/154531-wanted-method-that-doesnt-suck/
Share on other sites

For highlighting links you can use the pseudo hover class.

 

.element:hover {

  css: declaration;

}

 

To get this to work in IE, you'll have to make the row/(probably the <td></td> space) surrounded by an <a> tag as IE doesn't like to recognize hover on normal elements (if I remember correctly).

 

 

edit: for editing the status bar.  it's  not really possible.  there may be some hacks you can experiment with, but doubtful.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.