2

我需要你的 jquery 帮助。

这是一个在中间包含一个 jquery UI 选项卡部分的表。表格行当前显示/隐藏带有“onclick”的 UI 选项卡。

我需要解决的帮助是让表格行在页面加载自动隐藏“隐藏”选项卡部分,然后用户可以通过单击正常展开选项卡。有人可以快速轻松地解决这个问题吗?

请观看我的屏幕截图进行演示:http ://screencast.com/t/AAxUitL9O7

看看我的 HTML/Jquery 小提琴:http: //fiddle.jshell.net/rk7y4/11/

这是当前的实现:

 function CollaspeAll() {
        if ($(".ChildRow")[0]) {
            $('tr.ChildRow').children('td').each(function () {

                $(this).children('div').each(function () {
                    if ($(this).css('display') == 'block') {
                        $(this).css("display", "none");
                    }
                });
            });
        }

        $('img').each(function () {
            if ($(this).attr('src') == 'http://imageshack.us/scaled/landing/834/minusl.png') {
                $(this).attr('src', 'http://img338.imageshack.us/img338/6042/plusk.png');
            }
        });
    }
    function ExpandCollapse(TESTID) {
        $('#tabs' + TESTID).tabs();
        if ($('#div' + TESTID)) {

            // Is already ChildGrid shown. If not shown
            if (!isDisplayed($('#div' + TESTID))) {
                if ($('#hid' + TESTID).val() == '0') {
                    $('#div' + TESTID).css("display", "block");
                    $('#img' + TESTID).attr('src', 'http://imageshack.us/scaled/landing/834/minusl.png');
                    $('#hid' + TESTID).val("1");
                }
                else {
                    $('#div' + TESTID).css("display", "block");
                    $('#img' + TESTID).attr('src', 'http://imageshack.us/scaled/landing/834/minusl.png');
                }
            }
            else { // Already Child Grid Shown
                $('#div' + TESTID).css("display", "none");
                $('#img' + TESTID).attr('src', 'http://img338.imageshack.us/img338/6042/plusk.png');
            }
        }
    }
    function isDisplayed(object) {
        // if the object is visible return true
        if ($(object).css('display') == 'block') {
            return true;
        }
        // if the object is not visible return false
        return false;
    };

    $(".hand").hover(function () {
        $(this).addClass("blue");
    }, function () {
        $(this).removeClass("blue");
    });
4

0 回答 0