ローディング アニメーションを含む単純な表示/非表示スクリプトを作成しました。しかし、読み込みアニメーションは少なくとも 0.5 秒は必要です。
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#loading').hide();
$('#notesunlimitedcontent').hide();
$('#notescontent').show();
$('a#nsetcontent').click(function () {
$('#loading').show();
$('#notesunlimitedcontent').hide();
$('#notescontent').show();
$('#loading').hide();
});
$('a#nusetcontent').click(function () {
$('#loading').show();
$('#notescontent').hide();
$('#notesunlimitedcontent').show();
$('#loading').hide();
});
});
</script>
<a id="nsetcontent" href="#">show</a>
<a id="nusetcontent" href="#">show</a>
<div id="loading">
<img src="loading.gif"/>
</div>
<div id="notescontent">
</div>
<div id="notesunlimitedcontent">
</div>
jqueryは初めてなので、正しくコーディングしたかどうかはわかりません。しかし、私はそれをテストしました、それは2つのdivを表示および非表示にしますが、読み込み中のdivでそれが起こるのを見ませんでした。
ロード時間を少なくとも 0.5 秒にする方法を誰かが説明してくれることを願っています。
ありがとうございました!