响应式Lightbox:Magnific Popup
Magnific Popup是一个响应式Lightbox和对话框脚本,专注于性能并为使用任何设备的用户提供了最佳体验(jQuery 或 Zepto.js)。
它的特性:
轻量级或模块化
You can choose to include only the features that you need using the online build tool or by compiling it yourself with Grunt.js. Size of core JS file is about 3KB + each module weighs about 0.5KB (gzipped). Sass CSS preprocessor is used for easier skinning, but you're not obligated to use it.
利用CSS调整内容
The majority of lightbox plugins require you to define size of it via JS option. Magnific Popup does not - feel free to use relative units like EM's or resize lightbox with help of CSS media queries. Update content inside lightbox without worrying about how it'll resize and center.
快速
Magnific Popup displays images before they're completely loaded to take full advantage of progressive loading. For in and out transitions CSS3 is used instead of slow JavaScript animation.
High-DPI (Retina) 展示支持
Default controls are made with pure CSS, without external graphics. For the main image there is a built in way to provide appropriate source for different pixel density displays.
Conditional lightbox
Plugin has an option to automatically switch to alternative mobile-friendly source on small screen size. Brad Frost has a terrific article about this technique.
内存管理
Popup has an extendable micro templating engine that reuses existing DOM elements (example), which is especially useful when your popups same pattern.
浏览器支持情况:
Tested on desktop: Chrome, Safari, FF, Opera, IE8+, partial support of IE7 (works, but some visual layout features, like vertical centering, are missing). Mobile: default browser in Android 2.3+, iOS5+, Blackberry 10+, WP7+, mobile Opera and Chrome on Android.