View Full Version : Onmouseover Onmouseout Onload?

06-26-2009, 04:13 PM
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:

<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 />



This code displays the ratings when you mouseover and hides them when you mouseout because I have a javascript function set up:

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.

Jack Ellis
06-26-2009, 04:40 PM
You have the id as:


yet you try to hide and show it by doing

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

surely it should be

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


06-26-2009, 04:51 PM
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?

Jack Ellis
06-26-2009, 10:35 PM
In the td you have two style tags. Try adding display:hidden; to the first style="" bit in ur <td> tag.