Java脚本彼此矛盾

时间:2019-01-10 08:28:27

标签: javascript asp.net

使用此Java脚本在gridview中进行水平/垂直滚动。

<script type="text/javascript">
    $(document).ready(function () {
        ExtgridviewScroll();
    });

    function ExtgridviewScroll() {
        gridView1 = $('#GridView2').gridviewScroll({
            width: 950,
            height: 500,

            railcolor: "#F0F0F0",
            barcolor: "#CDCDCD",
            barhovercolor: "#606060",
            bgcolor: "#F0F0F0",
            freezesize: 1,
            arrowsize: 30,
            varrowtopimg: "Images/arrowvt.png",
            varrowbottomimg: "Images/arrowvb.png",
            harrowleftimg: "Images/arrowhl.png",
            harrowrightimg: "Images/arrowhr.png",
            headerrowcount: 1,
            railsize: 16,
            barsize: 15
        });
    }
</script>

但是当我在同一网页中使用以下Java脚本时,Gridview将失去由上述JS生成的“水平/垂直”滚动条。

<script type="text/javascript">
    function ShowProgress() {
        setTimeout(function () {
            var modal = $('<div />');
            modal.addClass("modalLoader");
            $('body').append(modal);
            var loading = $(".loadingLoader");
            loading.show();
            var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
            var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
            loading.css({ top: top, left: left });
        }, 200);
    }
    $('form').live("submit", function () {
        ShowProgress();
    });

</script>

为什么两者相互矛盾。

0 个答案:

没有答案