jQuery Show隐藏了错误

时间:2014-04-25 15:37:35

标签: javascript jquery html css

所以我无法弄清楚为什么越来越少的节目功能正在搞乱节目隐藏功能。我已经包含了一个jsfiddle和一个demo。当我试图再打开它时,它工作一次好然后搞砸了。按左上角img几次,你会看到问题。文字离开了div!

的jsfiddle:http://jsfiddle.net/LLDLT/ DEMO:http://aucblock.x10.mx/eric/edited/

jQuery代码:

$("#e").click(function (e) {
    $("#u").hide(200);
    $("#n").hide(200);
    $("#l").hide(200);
    $("#a").hide(200);
    $("#m").hide(200);
    $(".eew").hide(200);
    $("#s").show(200);
    $("#re").animate({
        "margin-left": "0px"
    }, 200);
    $("#r").animate({
        "margin-left": "0px"
    }, 200);
    $("#s").animate({
        "margin-left": "2px"
    }, 200);
    $("#u").animate({
        "margin-left": "2px"
    }, 200);
    $("#n").animate({
        "margin-left": "2px"
    }, 200);
    $("#l").animate({
        "margin-left": "2px"
    }, 200);
    $("#a").animate({
        "margin-left": "2px"
    }, 200);
    $("#m").animate({
        "margin-left": "2px"
    }, 200);
    e.stopPropagation();
    $('body').on('click', '.highl', function () {
        if ($('#s').css('height') === '190px') {
            $('#s').animate({
                'height': '92px'
            }, 200);
            $(".highl").text("More");
            $(".eew").hide(200);
        } else {
            $('#s').animate({
                'height': '190px'
            }, 200);
            $(".highl").text("Less");
            $(".eew").css("display", "inline");
        }
    });
    $('body').on('click', '.tri', function () {
        $('#s').hide(200);
        $('.eew').hide();
        $('#s').animate({
            "height": "92px"
        }, 200);
    });
});

1 个答案:

答案 0 :(得分:1)

因此,如果您检查检查员,您将看到父div.popu的确定高度设置为92像素。除非您允许高度为" auto"否则跨度中的溢出文本将始终显示在该场景中的背景图像之外。或者您将overflow:scroll添加到.popu