#buttonSaveArea
ページの読み込み時に要素を非表示にし、要素を表示したい#buttonSaveShower
。をクリックすると#buttonSaveShower
、非表示になり、表示される#buttonSaveArea
はずです。
問題は、$(document).ready
何度も呼び出されることです。それを回避する方法は?また、JavaScript が無効になっている場合は#buttonSaveArea
、最初から表示されるようにしたいと考えています。
$(document).ready(function(){
$("#buttonSaveArea").hide();
$("#buttonSaveShower").click(function(){
$("#buttonSaveArea").fadeIn();
$("#buttonSaveShower").hide();
});
});
<!------ The element that should show the button below ---------------->
<div class="button" id="buttonSaveShower" style="clear:both; margin-top:15px;">
<a href="" style="width:50px !important;"> edytuj </a>
</div>
<!------ Button: save ---------------->
<div class="fbCenter" id="buttonSaveArea">
<input type="submit" value="Zapisz" class="formButton"
onmouseover="this.className+=' pressed'"
onmouseout="this.className=this.className.replace(' pressed', '')"
/>
</div>