0
當切換菜單打開時,如何停止「按鈕」(「發送消息」)關閉切換功能,以便關閉切換菜單的唯一方法是單擊「發送」?「打開」切換按鈕jQuery
jQuery(document).ready(function() {
$("#container").hide();
$("#button").on('click', function() {
$("#container").toggle();
this.value = this.value == 'send message' ? 'contact' : 'send message';
});
$("#button2").on('click', function() {
$("#container").toggle();
$("#button").val('thank you');
});
});
#container {
height: 200px;
width: 200px;
position: relative;
background: red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="button" id="button" value="contact" />
<br />
<div id="container">
<input type="button" id="button2" value="send" />
</div>
'我怎樣才能阻止「按鈕」(「發送消息」)關閉切換菜單打開時切換功能,以便關閉切換菜單的唯一方法是單擊「發送」???'請解釋清楚一點.. – void