在提交表单时显示加载图像gif,直到页面在javascript中重定向

在提交表单时显示加载图像gif,直到页面在javascript中重定向,javascript,html,css,Javascript,Html,Css,我想向用户显示一个加载图标,直到表单提交和另一个页面元素完全加载(send.php)。如何使用javascript实现这一点,我希望使用javascript或jQuery实现这一点。这是我的密码: Index.html <body> <form name= "myform" id= "CC" action="send.php" > . . . </form> </body> CSS $(win

我想向用户显示一个加载图标,直到表单提交和另一个页面元素完全加载(
send.php
)。如何使用javascript实现这一点,我希望使用javascript或jQuery实现这一点。这是我的密码:

Index.html

<body>
   <form name= "myform" id= "CC" action="send.php" >
       .
       .
       .
   </form>
</body>
CSS

$(window).load(function() {
    // Animate loader off screen
    $(".se-pre-con").fadeOut("slow");;
});
.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/loader-64x/Preloader_2.gif) center no-repeat #fff;
}

有什么帮助吗?谢谢。

使用display:none加载程序,然后使用fadeouthere表单,该表单包含大量post元素,因此当我使用display none时会显示索引页面,我想在提交表单后禁用html页面,同时加载程序需要显示到send.php页面完成为止。
.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/loader-64x/Preloader_2.gif) center no-repeat #fff;
}