简单而小巧的纯 javascript 灯箱(对话框叠加)?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3585887/
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-10-25 01:37:50  来源:igfitidea点击:

Simple & small, pure javascript lightbox (dialog overlay)?

javascriptdialogoverlaylightbox

提问by Wesley

Does anyone know of a small, limited functionality lightbox built with pure javascript? This is for an embeddable widget, thus the reason of not using jquery. All I really need is creating an overlay for a specific div or simply by passing some HTML.

有谁知道用纯 javascript 构建的小型、功能有限的灯箱?这是一个可嵌入的小部件,因此不使用 jquery 的原因。我真正需要的只是为特定的 div 创建一个覆盖层,或者只是通过传递一些 HTML。

采纳答案by Josh Leitzel

There's a great list/comparison of lightboxes here. You can quickly scan which require a JS library (jQuery, MooTools, etc.) and which don't, and you can also see what features each supports. There's a sizable chunk of them that don't use any JS library, so you should be able to easily find one to suit your needs.

有一个伟大的名单/灯箱的对比在这里。您可以快速浏览哪些需要 JS 库(jQuery、MooTools 等),哪些不需要,还可以查看每个库支持哪些功能。其中有很大一部分不使用任何 JS 库,因此您应该能够轻松找到满足您需求的库。

Here's a few to get you started:

这里有一些让你开始:

回答by Felix Hagspiel

I am currently developing a light responsive Lightbox just for images, without the need for jQuery etc... and with IE8+ Support.

我目前正在开发一个光响应灯箱,仅用于图像,不需要 jQuery 等......并且支持 IE8+。

You can download it here

你可以在这里下载

Please report any bugs or issues. Thanks!

请报告任何错误或问题。谢谢!

回答by Nate Flink

I was looking for a more of a light weight modal dialog, and I found Zebra Dialog which uses Jquery.

我一直在寻找更轻量级的模态对话框,我找到了使用 Jquery 的 Zebra Dialog。

http://stefangabos.ro/jquery/zebra-dialog/

http://stefangabos.ro/jquery/zebra-dialog/