简单&小的纯javascript灯箱(对话框覆盖)?

2022-01-15 00:00:00 overlay dialog javascript lightbox

有人知道用纯 JavaScript 构建的小型、功能有限的灯箱吗?这是一个可嵌入的小部件,因此不使用 jquery 的原因.我真正需要的是为特定的 div 创建一个叠加层,或者只是传递一些 HTML.

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.

推荐答案

有一个很棒的灯箱列表/比较 这里.您可以快速扫描哪些需要 JS 库(jQuery、MooTools 等)哪些不需要,还可以查看每个支持的功能.其中有相当大的一部分不使用任何 JS 库,因此您应该能够轻松找到满足您需求的一个.

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.

这里有一些可以帮助您入门:

Here's a few to get you started:

  • EnlargeIt!
  • 浮动框
  • iBox

相关文章