td colspan does not work while using jquery show/hide()

后端 未结 9 511
走了就别回头了
走了就别回头了 2021-01-13 16:14

I have a table of content

First Name Last Name Des
9条回答
  •  醉梦人生
    2021-01-13 16:42

    The problem appears to be in the style applied when showing an element. It's setting the style to "display:block" which appears to be messing with colspan. Here are some workarounds that I came up with, but they're not perfect.

    This one has jerky annimation:

    personalChecking = function () {
        $('a.personal-checking-more-link').click(function() {
            $(this).parent().parent().next().toggle('slow', function() {
                if($(this).css('display') == 'block')
                {
                    $(this).css('display', '');
                }               
            });
        });
    }
    

    And this one has no annimation at all:

    personalChecking = function () {
        $('a.personal-checking-more-link').click(function() {
            var nextRow = $(this).parent().parent().next();
            if(nextRow.css('display') == 'none')
            {
                nextRow.css('display','');
            }
            else
            {
                nextRow.css('display', 'none');
            }
        });
    }
    

提交回复
热议问题