Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   jquery Expand Table Rows - where to insert code (http://forum.bytesforall.com/showthread.php?t=7055)

lrosenshine May 10, 2010 02:27 PM

jquery Expand Table Rows - where to insert code
 
Hello,

I am trying to incorporate some jquery function to expand table cells on click:
http://www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-with-jQuery-jExpand-plugin.aspx


I am a bit hesitant to mess around too much in the js.php file, as I'm not sure where to insert the jquery js code:
Code:

(function($){
    $.fn.jExpand = function(){
        var element = this;

        $(element).find("tr:odd").addClass("odd");
        $(element).find("tr:not(.odd)").hide();
        $(element).find("tr:first-child").show();

        $(element).find("tr.odd").click(function() {
            $(this).next("tr").toggle();
        });
       
    }   
})(jQuery);

I am also a bit worried this might conflict with the scripting already running to highlight cells on mouse over (but I guess I can deal with that once I try to implement it.

Wordpress 2.9.2
Atahualpa 3.4.6

Thanks for any help!


All times are GMT -6. The time now is 04:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.