B i t s O f S h a r e P o i n t C o n s u l t i n g L L C > B l o g P o i n t > Posts > JQuery - Solutions - Highlight list Item -Updated
JQuery - Solutions - Highlight list Item -Updated

Since my last post on 1/14/09 with regards to highlighting list items, I have tested it out with different lists and have refined the code.  This now works on many more lists then before.  I have implement it on this site.

I have added it to the master page so that it will be available to the whole site.  You do not have to do this.  The code that I provided below can be used as is with a Content Editor Web Part and added to any page.

The original code was from  from http://weblogs.asp.net/jan/.  Here he posted a solution for highlighting a row in a list as you mouse over it.  I have made only a change to how you reference the JQuery files.  Post: http://weblogs.asp.net/jan/archive/2008/11/24/sharepoint-2007-and-jquery-2.aspx

My site uses this code throughout.  You should be able to see the results anywhere you go.

Here is the code:

<script type="text/javascript">
 
$(document).ready(function()
    {
     $("table.ms-listviewtable tr").hover      
        (
            function() {
                $(this).addClass("myRowHighlight");
            },
            function() {
                $(this).removeClass("myRowHighlight");
            }
        );
     $("table.ms-summarystandardbody tr").hover        
        (
            function() {
                $(this).addClass("myRowHighlight");
            },
            function() {
                $(this).removeClass("myRowHighlight");
            }
        );
     $("table.ms-navsubmenu2 tr").hover        
        (
            function() {
                $(this).addClass("myRowHighlight");
            },
            function() {
                $(this).removeClass("myRowHighlight");
            }
        );
    }
);
 
</script>

Comments

There are no comments yet for this post.
Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Addition: 2 + 1 = *


Please complete this equation.

Email


This is optional.
Attachments

 T o p i c P o i n t

 E x a m p l e P o i n t