Twitter Bootstrap模态窗口(Twitter Bootstrap Modal Window)

编程入门 行业动态 更新时间:2024-10-27 08:37:16
Twitter Bootstrap模态窗口(Twitter Bootstrap Modal Window)

单击按钮我想显示模态窗口。

这是我实施的。

<a class="btn addIdeaBtn" data-toggle="modal" href="#addIdea" >Launch Modal</a> <!-- Model Window ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <div class="modal hide fade in" id="addIdea"> <div class="modal-header"> <button class="close" data-dismiss="modal">×</button> <h3>Add Idea</h3> </div> <div class="modal-body"> <form action="" method="post"> <textarea id="addIdeaPopUp" class="tinymce" name="" cols="" rows=""></textarea> </form> </div> <div class="modal-footer"> <a href="home.html" class="btn">Close</a> <a href="home.html" class="btn btn-primary">Add Idea</a> </div> </div>

当我单击按钮时,模态窗口出现然后消失:P

http://mink7.com/projects/cmrc/idea_exchange.html

按钮位于屏幕底部,左侧粘贴为页脚。

On clicking a Button i want to show a Modal Window.

This is what i have implemented.

<a class="btn addIdeaBtn" data-toggle="modal" href="#addIdea" >Launch Modal</a> <!-- Model Window ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <div class="modal hide fade in" id="addIdea"> <div class="modal-header"> <button class="close" data-dismiss="modal">×</button> <h3>Add Idea</h3> </div> <div class="modal-body"> <form action="" method="post"> <textarea id="addIdeaPopUp" class="tinymce" name="" cols="" rows=""></textarea> </form> </div> <div class="modal-footer"> <a href="home.html" class="btn">Close</a> <a href="home.html" class="btn btn-primary">Add Idea</a> </div> </div>

When i click the Button the modal window appears and then vanishes :P

http://mink7.com/projects/cmrc/idea_exchange.html

The button is at the bottom of the screen to the left sticking as a footer.

最满意答案

尝试从模态中删除课堂内容。 JS会自动在hide和in之间切换。 由于您的按钮设置为切换模态,因此它会消失,因为它认为它是可见的。

含义: <div class="modal hide fade" id="addIdea">

Try removing the in class from your modal. The JS automatically toggles between hide and in. Since your button is set to toggle the modal, it disappears, because it believes it is visible.

Meaning: <div class="modal hide fade" id="addIdea">

更多推荐

本文发布于:2023-08-06 23:46:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1457462.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗口   模态   Bootstrap   Twitter   Modal

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!