<script> function load1(name) { loading.style.display="none"; name.style.display=""; } function selecte(s) { if(s==1) { loading.style.display=""; div_b.style.display="none"; div_c.style.display="none"; div_d.style.display="none"; setTimeout("load1(div_a)",2000); } if(s==2) { loading.style.display=""; div_a.style.display="none"; div_c.style.display="none"; div_d.style.display="none"; setTimeout("load1(div_b)",2000); } if(s==3) { loading.style.display=""; div_a.style.display="none"; div_b.style.display="none"; div_d.style.display="none"; setTimeout("load1(div_c)",2000); } if(s==4) { loading.style.display=""; div_a.style.display="none"; div_b.style.display="none"; div_c.style.display="none"; setTimeout("load1(div_d)",2000); } } </script> <select name="singerarea" onchange="selecte(this.options[this.options.selectedIndex].value)"> <option value="0">请选择</option> <option value="1">CssRain1</option> <option value="2">CssRain2</option> <option value="3">CssRain3</option> <option value="4">CssRain4</option> </select> <div id="loading" style="display:none;"> <img src="http://www.aspbc.com/pic/loading.gif"> </div> <div id="div_a" style="display:none;" > <input type="text" value="1111111"> </div> <div id="div_b" style="display:none;" > 你选择了 地区2 </div> <div id="div_c" style="display:none;" > <input type="button" value="button"> </div> <div id="div_d" style="display:none;" > from cssrain js demo. </div>(鼠标移到代码上去,在代码的顶部会出现四个图标,第一个是查看源代码,第二个是复制代码,第三个是打印代码,第四个是帮助)
以下代码实现ajax正在提交效果:loading....