SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Why wont this work?

    This code works in MSIE 6 and Opera 7.1 but not NN 7 or Mozilla 1.3. Can anyone pinpoint the problem?

    Javascript Code
    Code:
    function rowOver(obj,changeColor) {
     if (obj.className == "linkrow") {
      obj.style.backgroundColor="#" + changeColor;
      obj.style.cursor='hand';
     }
    }
    function rowOut(obj) {
     if (obj.className == "linkrow") {
      obj.style.backgroundColor="transparent";
      obj.style.cursor="auto";
     }
    }
    function changeMain(newLocation){
     top.location.href = newLocation + ".asp";
    }
    Code in ASP file
    Code:
    <td width="10" align="center" valign="middle" class="linkrow" onMouseOver="rowOver(this,'3C4425');" onMouseOut="rowOut(this);" onClick="changeMain('home');"><img src="/images/nav_home.gif" width="24" height="6" hspace="16" align="absmiddle"></td>
    In MSIE and Opera mousing over the table cell that contains said code will change it's BG color to the defined color, and mousing off will restore the background. Sort of a highlite method. Suprised NN7/Moz1.3 don't support it, it doesn't seem to use any DOM proprietary coding...

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a possibility:

    cursor: hand

    ...is MSIE-only. Everywhere else it's cursor: pointer. Might be an invalid argument.

  3. #3
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I found out was wrong, and it had to do with code I didn't show. I had a function called goto, and I guess that's a reserved name. Renamed the function to GotoSame() and it now works in MSIE 6 / NN7 / Mozilla 1.3 / Opera 7.1

  4. #4
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by adios
    Just a possibility:

    cursor: hand

    ...is MSIE-only. Everywhere else it's cursor: pointer. Might be an invalid argument.
    Er, without meaning to sound patronising, the "pointer" and "hand" are completely different cursor types, and they do what they say they do in every browser that supports that CSS attribute (which is most)...!??
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by M@rco
    Er, without meaning to sound patronising, the "pointer" and "hand" are completely different cursor types, and they do what they say they do in every browser that supports that CSS attribute (which is most)...!??
    Thanks for the heads-up.

    http://www.w3.org/TR/2002/WD-CSS21-20020802/ui.html

    http://lists.evolt.org/harvest/detai...000717&id=1801

  6. #6
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    M@rco, I'm not quite sure I follow your categorisation of 'hand' and 'pointer' as "completely different" cursor types.

    Given that 'pointer' conforms the cursor to an 'over link' behaviour and the standard appearance for a cursor over a link is a (gloved) pointing 'hand', I'm not sure how the two can be said to be completely different.

    They are visually and effectively identical in practice.

    Please explain.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  7. #7
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Bill Posters
    M@rco, I'm not quite sure I follow your categorisation of 'hand' and 'pointer' as "completely different" cursor types.

    Given that 'pointer' conforms the cursor to an 'over link' behaviour and the standard appearance for a cursor over a link is a (gloved) pointing 'hand', I'm not sure how the two can be said to be completely different.

    They are visually and effectively identical in practice.

    Please explain.
    Good god! You're absolutely right! I was sure that "pointer" was the normal arrow cursor, but evidently not! They ARE both the same, and there ARE cross-browser problems with which value to use (as the Evolt link discusses).

    Thank you! I stand (or rather, sit) corrected! (Oops!)



    PS - ignore my previous post!
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  8. #8
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Go to your room.

  9. #9
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!


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
  •