Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Onmouseover Onmouseout Onload?

    Not sure if this belongs in this forum and if it does not, I apologize.

    I'm looking for some help. I have a code:

    Code:
    <td class="{$post['post_css']}" style="vertical-align:bottom;border-left:1px solid #fff" id='post-main-{$post['pid']}' onmouseover="OnHoverPost( '{$post['pid']}' );" onmouseout="OnUnHoverPost( '{$post['pid']}' );" style="display:none;">
    
    
    			<if="author['mgroup'] != 14">
    			{$post['signature']}<br /><br />
    			</if>
    
    {$post['ratings']}
    
    </td>
    This code displays the ratings when you mouseover and hides them when you mouseout because I have a javascript function set up:

    Code:
    function OnHoverPost( $postid )
    {
    	$( 'rb_' + $postid ).show();
    }
    
    function OnUnHoverPost( $postid )
    {
    	$( 'rb_' + $postid ).hide();
    }
    My problem is that I want the ratings to be hidden by default and only show up when you mouseover and then hide again when mouseout. Right now the ratings are showing by default. Can anyone help me, how would I go about hiding the ratings by default? Thanks in advance.

  • #2
    New Coder
    Join Date
    Jun 2009
    Location
    West Sussex
    Posts
    27
    Thanks
    0
    Thanked 4 Times in 4 Posts
    You have the id as:

    id='post-main-{$post['pid']}'

    yet you try to hide and show it by doing

    $( 'rb_' + $postid ).show();

    surely it should be

    $('#post-main-'+ $postid).show();

    ?

  • #3
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Jack,
    So I changed the id to 'rb_{$postid}' and that's fine, but that wasn't the original problem, the onmouseover and onmouseout was working fine beforehand.

    I just want the ratings portion to be hidden by default and only show onmouseover. That was my original issue. Would you (or anyone else) know how to help me with this?

  • #4
    New Coder
    Join Date
    Jun 2009
    Location
    West Sussex
    Posts
    27
    Thanks
    0
    Thanked 4 Times in 4 Posts
    In the td you have two style tags. Try adding display:hidden; to the first style="" bit in ur <td> tag.


  •  

    Posting Permissions

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