source: t29-www/shared/js-v6/modules/lightbox.js @ 796

Last change on this file since 796 was 796, checked in by sven, 9 years ago

Bezugnehmend auf letztes Update: Popups auch in der Seitenleiste aktiviert.

File size: 1.3 KB
Line 
1/**
2 * technikum29.de | Lightbox-Implementierung
3 *
4 * Nutze Fancybox (http://www.fancybox.net) als Lightbox-Variante seit
5 * Februar 2011, an verschiedenen Stellen.
6 *
7 **/
8 
9if(!t29) window.t29 = {}; // the t29 namespace
10
11t29.lightbox = {};
12
13t29.lightbox.paths = {
14        'css': "/shared/js/fancybox/jquery.fancybox-1.3.4.css",
15        'js': "/shared/js/fancybox/jquery.fancybox-1.3.4.pack.js"
16};
17
18t29.lightbox.setup = function() {
19        var elements = $("#content .popup, nav.side.contains-custom .popup");
20        if(elements.length) {
21                // we have fancybox elements on this page. Load Javascript and CSS
22                t29.load.css(t29.lightbox.paths.css);
23                t29.load.js(t29.lightbox.paths.js, function(){
24                        elements.fancybox({
25                                //margin: 0,
26                                onComplete: function() {
27                                        // etwas quick and dirty:
28                                        if(! this.orig.is(".no-copyright")) {
29                                                t29.img_license.apply( $("#fancybox-img") );
30                                                // little hacky:
31                                                $("#img-license-tag").css("z-index", "10000"); // make sure much bigger than fancybox
32                                                // fire "hover in" because images are typically big
33                                                // and mouse cursor may not move on picture
34                                                t29.img_license.hover_in.call($("#fancybox-img")[0]);
35                                        }
36                                },
37                                onClosed: function() {
38                                        // wieder de-applying
39                                        $("#fancybox-img").unbind('mouseenter mouseleave');
40                                }
41                        });
42                });
43        } // if lightbox elements
44}
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License