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

Last change on this file since 357 was 357, checked in by sven, 11 years ago

t29Host-Webroot-System entwickelt.

Damit können Installationen der technikum29-Website ab nun auch in Unterverzeichnissen
(bislang allerdings nur unterhalb des DocumentRoots) installiert werden, was einem
größere Flexibilität beim lokalen Aufsetzen der Seite liefert

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");
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                                onComplete: function() {
26                                        // etwas quick and dirty:
27                                        if(! this.orig.is(".no-copyright")) {
28                                                t29.img_license.apply( $("#fancybox-img") );
29                                                // little hacky:
30                                                $("#img-license-tag").css("z-index", "10000"); // make sure much bigger than fancybox
31                                                // fire "hover in" because images are typically big
32                                                // and mouse cursor may not move on picture
33                                                t29.img_license.hover_in.call($("#fancybox-img")[0]);
34                                        }
35                                },
36                                onClosed: function() {
37                                        // wieder de-applying
38                                        $("#fancybox-img").unbind('mouseenter mouseleave');
39                                }
40                        });
41                });
42        } // if lightbox elements
43}
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