0
當我第一次單擊保存按鈕時,警報顯示正常。但每次之後,除非我進行硬刷新,否則警報不會顯示。在JSFiddle中僅顯示一次引導警報
這裏是的jsfiddle:JSFiddle
$("#success-alert").hide();
$("#saveChange").click(function showAlert() {
$("#success-alert").alert();
$("#success-alert").fadeTo(2000, 500).slideUp(500, function() {
$("#success-alert").alert('close');
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"/>
<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js"></script>
<div class="product-options">
<button id="saveChange" href="javascript:;" class="btn btn-mini">Save</button>
</div>
<div class="alert alert-success" id="success-alert">
<button type="button" class="close" data-dismiss="alert">x</button>
<strong>Success! </strong>
Your changes has saved.
</div>
您可以鏈接jsFiddle本身嗎? – nurdyguy
@nurdyguy事實上,編輯刪除它,[這是](http://jsfiddle.net/mfX57/953/)鏈接 – Li357
我也編輯它。感謝幫助新手:) – Yes