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

查看:21
本文介绍了在不使用 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'no 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天全站免登陆