SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem using css with mouseover....

    i use this to change the status bar display for links: <a href="page_name.html" onmouseover="self.status='new page name';return true" onmouseout="self.status='';return true">go to new page</a>

    i thought i'd used it successfully with css before but for some reason it won't work with the css file i'm using now - i've got the a:hover set to change the background color along with text-decoration:overline and it would not work until i took out the onmouseover="self.status..../onmouseout="self.status=...

    any suggestions??

  2. #2
    Weird Little Girl Desdelena's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I always use this.

    Code:
    <a href="..." onMouseover="window.status='text';return true" onMouseout="window.status=' ';return true" class/id="class/id-name">text</a>
    In your code the onMouseout might be messing it up. Youve got a double quote in the red part of my code above. I believe you should actually have something there.

  3. #3
    Posts rarely lloydi's Avatar
    Join Date
    Jan 2002
    Location
    Swindon UK
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Of course, there is an argument that:

    * window.status messages only increase page weight
    * window.status messages cause problems for maintenance of web pages (can you imagine having to put these in site-wide?)
    * window.status messages are more likely to cause needless script errors
    * window.status messages are vary rarely any use

    If you have meaningful file names, this is usually more helpful. In addition, using a title attribute on the link instead will usually be better - it is read by screen readers, indexed by search engines and is supported by most browsers out there these days.

    That's my five cents' worth, anyway.
    Build Your Own Web Site the Right Way!
    A beginners' HTML/CSS book with web standards at its heart
    The Ultimate HTML Reference
    A complete reference, in glorious hardback

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    thanks!!

    thanks to both of you for your help. i double checked that i had two ' instead of " and it still won't work. i tried window.status and it doesn't work either....so i'm taking lloydi's advice and leaving it out altogether.

    lloydi - what is a 'title attribute on the link'?

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <a title="some title text">

  6. #6
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i hate to appear ignorant although i freely admit to being just that....i tried it to see if it created a popup description box thing like images do, and it doesn't. what's the purpose of the 'title'?

  7. #7
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Values of the title attribute may be rendered by user agents in a variety of ways. For instance, visual browsers frequently display the title as a "tool tip" (a short message that appears when the pointing device pauses over an object). Audio user agents may speak the title information in a similar context.
    Read more.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •