Javascript 布局中mvc中的预加载程序在其他页面中不起作用

Javascript 布局中mvc中的预加载程序在其他页面中不起作用,javascript,jquery,razor,model-view-controller,Javascript,Jquery,Razor,Model View Controller,我(MVC中的新手)在布局页面中使用jquery添加了一个预加载程序,应该在MVC中的每个页面加载 问题是它只在登录页面上激发,但不会在后续页面上激发。有没有办法使它成为通用的 ...................... <script type="text/javascript"> $(window).load(function () { // Animate loader off screen $(".se-pre-con").fadeO

(MVC中的新手)
布局页面
中使用
jquery
添加了一个
预加载程序
,应该在MVC中的每个
页面加载

问题是它只在
登录
页面上激发,但不会在后续页面上激发。有没有办法使它成为通用的

......................
<script type="text/javascript">
    $(window).load(function () {
        // Animate loader off screen
        $(".se-pre-con").fadeOut("slow");;
    });
</script>
<style type="text/css">
    .no-js #loader
    {
        display: none;
    }

    .js #loader
    {
        display: block;
        position: absolute;
        left: 100px;
        top: 0;
    }

    .se-pre-con
    {
        position: fixed;
        left: 0px;
        top: 0px;
        width: 100%;
        height: 100%;
        z-index: 9999;
        background: url(images/Preloader_3.gif) center no-repeat #fff;
    }
</style>
</head>

<body>
    <div id="wrapper">
        @Html.Action("Navbar", "Navbar", new { controller = ViewContext.RouteData.Values["Controller"].ToString(), action = ViewContext.RouteData.Values["Action"].ToString() })

 <div id="page-wrapper">  
    <div id="main">
        <div class="ptcontainer">
<div id="loader" class="se-pre-con"></div>
            @RenderBody()

        </div>
        <div id="footer">
        </div>
    </div>
</div>
</div>
。。。。。。。。。。。。。。。。。。。。。。
$(窗口)。加载(函数(){
//在屏幕外设置加载程序动画
美元(“.se pre con”)。淡出(“慢”);;
});
.no js#装载机
{
显示:无;
}
.js#加载器
{
显示:块;
位置:绝对位置;
左:100px;
排名:0;
}
.se预检
{
位置:固定;
左:0px;
顶部:0px;
宽度:100%;
身高:100%;
z指数:9999;
背景:url(images/preload_3.gif)中心不重复#fff;
}
@Action(“Navbar”,“Navbar”,新的{controller=ViewContext.RouteData.Values[“controller”].ToString(),Action=ViewContext.RouteData.Values[“Action”].ToString())
@RenderBody()

提前谢谢

您的代码是正确的,但您只需将斜杠插入背景url图像即可

background: url(/images/Preloader_3.gif) center no-repeat #fff;