I have a select box that directs users to another page when an item is selected. 当用户选择一个项目时,我想显示某种 loading.gif,这样他们就知道发生了什么事。有人可以告诉我如何做到这一点吗?
<!DOCTYPE html>
<html lang="en">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$("sRedirect").change(function(){
$("#sRedirect :selected").not(:contains('Click Here To Select')).siblings("img").first().attr('src','loading.gif');
});
</script>
</head>
<body>
<div class="titleBar">
<div class="Logo"><a class ="backBtn" href="javascript:history.back();"> </a><img src="logotop.png" align="right" />
</div>
<br><br>
<div class="top"><br><br><h2>Step 1<br><br>Choose an Area</h2><br><br> <div>
<div class="middle">
<form name=form1>
<select name="URL" id="sRedirect" onchange="window.location.href=this.form.URL.options[this.form.URL.selectedIndex].value" onfocus="javascript:toggle();" >
<option value="" disabled="disabled" selected="selected">Click Here To Select</option>
<?=$options?>
</SELECT>
<br>
<img src="" id="myLoadingPicture"/>
</form>
</div>
</html>