[TYPO3-german] Lightbox für Media-Element

Rainer Schleevoigt rainer at webmasterei-hamburg.de
Mon Oct 17 18:58:06 CEST 2011


Habs gefunden:

$(document).ready(function() {
   $("a img").each(function() {
   var link = $(this.parentNode)
     var href = link.attr('href');
     if (href.match(/\.swf$/i)||href.match(/\.jpg$/i)){
        link.addClass('ceebox');
     }
     if (href.match(/\.flv$/i)){
        link.addClass('ceeboxflv');
     }
     if (href.match(/\.pdf$/i)){
        link.addClass('ceeboxpdf');
     }

  });
   $('.ceebox').ceebox();
   $(".ceeboxflv").click(function() {
     $.fn.ceebox.overlay();
     // für Video Container einbauen:
     $.fn.ceebox.popup('<div style="width:'+vwidth+',height:'+vheight+'" 
id="flvcontainer" rel="'+$(this).attr('href')+'"></div>',{
           width : vwidth-10,
           height : vheight-10,
                 onload : function() {
                    var url =   
'/fileadmin/templates/mediaplayer.swf?repeat=always&controlbar=over&displayheight='+parseInt(vheight,10)+'&stretching=exactfit&icon=true&shownavigation=true&autostart=1&file=' 
+ encodeURIComponent('/' + $('#flvcontainer').attr('rel')) ;
             $('#flvcontainer').flash({
                   swf      :  url,
                 autostart  : true,
                 width     : vwidth-10,
                 height    : vheight-10,
                 wmode     : 'transparent'
                });

           }

               }
       );


       return false;
   });

Das klappt wunderbar.

-- 
Dipl.-Ing. Rainer Schleevoigt
Webmasterei Hamburg
Certified TYPO3 Integrator
Hamburger AppWerft
iPhone/Android Developer
22303 Hamburg
Novalisweg 10



More information about the TYPO3-german mailing list