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

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 02-14-2010, 11:18 AM   PM User | #1
likon
Regular Coder

 
Join Date: Apr 2007
Posts: 141
Thanks: 3
Thanked 1 Time in 1 Post
likon is an unknown quantity at this point
jquery row highlight

hi guys i have a problem with jquery and css

Code:
	$("#bordercolor tbody td").hover(
    function() 
    {
        // This gets executed on mouse-over
        $(this).addClass('hover');
    }, 
    function() 
    {
        // This is the callback, so it gets executed on mouse-out
        $(this).removeClass('hover');
    }
it will hover the td element of table with id="bordercolor"

now the problem is i have 2 td but i just want to highlight the td for title not for content

Code:
                  <tr>
                    <td class="windowbg2" align="left" valign="top" width="100%"><b><a href="#"><?php echo $item->get_title(); ?></a></b><br></td>
                  </tr>
                  <tr>
                    <td>
						<p><?php echo $item->get_content(); ?></p>
						
						
					</td>
                  </tr>

see the first td is to display title and second td is to display content

i just want that jquery to hover the title not the content.

i know it has got something to do with $("#bordercolor tbody td")

but i am not quite sure how css pair with jquery ( or javascript ) in too much detail.

thanks
likon is offline   Reply With Quote
Old 02-15-2010, 11:57 AM   PM User | #2
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
I think the simplest - and most semantically correct - way would be to put your table titles into TH tags rather than TD ones. That way you could apply your hovering code to $("#bordercolor tbody th")
Spudhead 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 07:08 AM.


Advertisement
Log in to turn off these ads.