在不使用jqueryui的情况下使用'x'显示模式对话框 [英] Show modal dialog with 'x' without using jqueryui

查看:91
本文介绍了在不使用jqueryui的情况下使用'x'显示模式对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

寻找一种不使用jquery UI的非常简单的模式对话框实现.

looking for a very simple implementation of modal dialog box without using jquery UI.

仅举一例

<div class="modal" id="something" style="display: none;">
   <div class "titlebar">
      <h4>title</hr>
      <a href="#" >xx</a>
   </div>
   <div class=content></div>
  <div class=footer></div>
</div>

当用户单击按钮时,我要显示对话框,并在用户单击"xx"时关闭.我看到了一些示例,但它还有很多其他功能.我正在寻找某种东西,例如单击按钮显示对话框,它应该一直呆到用户单击"x"而不是jqueryui为止.

When user click on the button I want to show dialog and close when user pres 'xx'. I saw some example but it has many extras. I am looking for somethig like click of button show dialog it shoud stay there till user clicks on 'x' no jqueryui.

任何简单的例子都很好.

any simple example will be great.

推荐答案

我认为您正在寻找类似的东西:

I think you're looking for something like this:

$('.modal .titlebar a').click(function() {
  $(this).parents('.modal').hide();
});

$('button.open-modal').click(function() {
  $('#something').show();
});

这篇关于在不使用jqueryui的情况下使用'x'显示模式对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆