javascript - LeanModal.js - X 单击时关闭模态框

标签 javascript jquery modal-dialog

需要一些有关 this query 的帮助

你们有什么办法可以帮忙吗?

-R

最佳答案

您必须修改leanModal.js来源并添加 <img>有一些样式和 click()处理程序调用 close_modal() .

代码:

$("<img />").css({
  // styling for the img
  'position': 'fixed', 'top':  o.top + 'px', 'left': '50%'
}).click(function() {
  // onclick behaviour - just close it
  close_modal(modal_id); 
  // icon URL   vvvvvvvvvvvvvvvvvvvvv
}).attr('src', 'http://bit.ly/ttN6Qs').appendTo($(modal_id));

查看工作代码 HERE

样式和图标放置非常原始,但您应该能够按照自己的喜好进行修改。这只是一个演示:)。

关于javascript - LeanModal.js - X 单击时关闭模态框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8439457/

相关文章:

javascript - 简单的重构会消除 react 性

c# - 从 MVC Controller 返回 Json 但日期格式在 javascript 中不正确

javascript - jQuery 通过单击按钮聚焦于警报框

javascript - 从 Controller Angular js显示模态

Jquery - 当浏览器调整大小时调整蒙版大小?

javascript - Twilio 视频 : how to tell if a track is a screenshare?

javascript - 运行完后重新启动动画

jQuery jquery-tmpl 路线图

Javascript 函数调用给出了意想不到的奇怪结果。

javascript - 如何在 displaystyle (MathJax) 中显示 asciimath 方程