Results 1 to 7 of 7

Thread: on mouse out error

  1. #1
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Smile on mouse out error

    Does anyone know why this won't work?

    HTML Code:
    <html>
    <head>
    
    </head>
    <body>
    <center>
    <p>
    <font size="+5" color="purple">keyboard1333S IS <div onMouseOver="changeText()" onMouseOut="çhangeTexte()" id="status">EPIC</div>
    </font>
    </p>
    </center> 
    </body>
    </html>
    
    <script>
    function changeText()
    {
    document.getElementById("status").innerHTML='Awesome'
    }
    </script>
    
    <script>
    function changeTexte()
    {
    document.getElementById("status").innerHTML='Epic'
    }
    </script>
    Any help would be great!
    Last edited by keyboard; 09-29-2011 at 11:30 PM.

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    There's a cedilla over the "c" in the onmouseout function for some reason. Try changing:
    Code:
    <font size="+5" color="purple">keyboard1333S IS <div onMouseOver="changeText()" onMouseOut="çhangeTexte()" id="status">EPIC</div>
    To:
    Code:
    <font size="+5" color="purple">keyboard1333S IS <div onMouseOver="changeText()" onMouseOut="changeTexte()" id="status">EPIC</div>
    - Mike

  3. #3
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    Yeah, works fine now. Don't know why it did that. Thanks for your help!

  4. #4
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    One more thing guys


    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <style type="text/css">
    .hide {
        display:none;
     }
    .show {
        display:block;
     }   
    </style>
    
    <script type="text/javascript">
       var el;
    window.onload=function() {
       el=document.getElementById('status');
       el.onmouseover=function() {
       changeText('hide','show')
     }
       el.onmouseout=function() {
       changeText('show','hide');
      }
     }
    function changeText(cl1,cl2) {
       document.getElementById('span1').className=cl1;
       document.getElementById('span2').className=cl2;
    }
    </script>
    
    </head>
    <body>
    
    <center>
    <font size="+5">
    KEYBOARD1333 IS
    <p id="status">
    <span id="span1">EPIC</span>
    <span id="span2" class="hide">AWESOME</span>
    </p>
    </font>
    </center>
    </body>
    </html>

    DO you know how I can make the Keyboard1333 is and the epic/amazing on the same line?

    any help would be great
    Last edited by keyboard; 09-28-2011 at 10:57 PM. Reason: CAUSE I CAN'T SPELL

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Try changing:
    Code:
    <p id="status">
    To:
    Code:
    <p id="status" style=" display: inline; ">
    - Mike

  6. #6
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    It works when I first load it, but when I mouse over the Epic the epic/awesome moves onto the next line.

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    In your CSS, change:

    Code:
    .show {
        display:block;
     }
    to:

    Code:
    .show {
        display:inline
     }
    Block causes an element to take up an entire "row" of space, whereas inline keeps it all text width.
    - Mike

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
  •