Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-26-2009, 04:13 PM   PM User | #1
Padgoi
New to the CF scene

 
Join Date: Sep 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Padgoi is an unknown quantity at this point
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.
Padgoi is offline   Reply With Quote
Old 06-26-2009, 04:40 PM   PM User | #2
Jack Ellis
New Coder

 
Join Date: Jun 2009
Location: West Sussex
Posts: 27
Thanks: 0
Thanked 4 Times in 4 Posts
Jack Ellis is an unknown quantity at this point
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();

?
Jack Ellis is offline   Reply With Quote
Old 06-26-2009, 04:51 PM   PM User | #3
Padgoi
New to the CF scene

 
Join Date: Sep 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Padgoi is an unknown quantity at this point
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?
Padgoi is offline   Reply With Quote
Old 06-26-2009, 10:35 PM   PM User | #4
Jack Ellis
New Coder

 
Join Date: Jun 2009
Location: West Sussex
Posts: 27
Thanks: 0
Thanked 4 Times in 4 Posts
Jack Ellis is an unknown quantity at this point
In the td you have two style tags. Try adding display:hidden; to the first style="" bit in ur <td> tag.
Jack Ellis is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:18 AM.


Advertisement
Log in to turn off these ads.