jQuery 隐藏推特引导按钮

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19424405/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 23:55:17  来源:igfitidea点击:

Hide twitter bootstrap button

jquerycsstwitter-bootstrap

提问by MikeAlike234

Is there a way to make a twitter bootstrap modal button not appear on certain conditions, so that it dont show up when opening the modal?

有没有办法让 Twitter 引导模式按钮在某些条件下不出现,以便在打开模式时不显示?

And on another condition turn it back on again.

在另一种情况下再次打开它。

<a href="#" id="edit-modal-button" class="btn btn-warning" data-dismiss="modal"> Edit </a>

Update:

更新

The button to hide is inside the modal

要隐藏的按钮位于模态内

Ive tried the following to no avail

我试过以下无济于事

$("edit-modal-button").css('display','none'); 

$('edit-modal-button').hide(); 

回答by

Assuming the button's ID is edit-modal-button; $('#edit-modal-button').hide();will work, you just have to put in #to indicate you are referring to the elements ID.

假设按钮的 ID 是 edit-modal-button;$('#edit-modal-button').hide();会起作用,您只需要输入#以表明您指的是元素 ID。