Team:SDU-Denmark/pirobox.min.js

From 2012.igem.org

Revision as of 21:20, 30 August 2012 by Asbiorn (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

/**

  • Name: piroBox v.1.2.2
  • Date: May 2010
  • Autor: Diego Valobra (http://www.pirolab.it),(http://www.diegovalobra.com)
  • Version: 1.2.2
  • Licence: CC-BY-SA http://creativecommons.org/licenses/by-sa/2.5/it/
    • /
(function($){$.fn.piroBox=function(opt){opt=jQuery.extend({my_speed:null,close_speed:300,bg_alpha:0.5,close_all:".piro_close,.piro_overlay",slideShow:null,slideSpeed:null},opt);function start_pirobox(){var corners="<tr>"+'<td colspan="3" class="pirobox_up"></td>'+"</tr>"+"<tr>"+'<td class="t_l"></td>'+'<td class="t_c"></td>'+'<td class="t_r"></td>'+"</tr>"+"<tr>"+'<td class="c_l"></td>'+'<td class="c_c">
</td>'+'<td class="c_r"></td>'+"</tr>"+"<tr>"+'<td class="b_l"></td>'+'<td class="b_c"></td>'+'<td class="b_r"></td>'+"</tr>"+"<tr>"+'<td colspan="3" class="pirobox_down"></td>'+"</tr>";var window_height=$(document).height();var bg_overlay=$(jQuery('
').hide().css({"opacity":+opt.bg_alpha,"height":window_height+"px"}));var main_cont=$(jQuery('
'));var caption=$(jQuery('
'));var piro_nav=$(jQuery('
'));var piro_close=$(jQuery('<a href="#close" class="piro_close" title="close"></a>'));var piro_play=$(jQuery('<a href="#play" class="play" title="play slideshow"></a>'));var piro_stop=$(jQuery('<a href="#stop" class="stop" title="stop slideshow"></a>'));var piro_prev=$(jQuery('<a href="#prev" class="piro_prev" title="previous image"></a>'));var piro_next=$(jQuery('<a href="#next" class="piro_next" title="next image"></a>'));$("body").append(bg_overlay).append(main_cont);main_cont.append(corners);$(".pirobox_up").append(piro_close);$(".pirobox_down").append(piro_nav);$(".pirobox_down").append(piro_play);piro_play.hide();$(".pirobox_down").append(piro_prev).append(piro_next);piro_nav.append(caption);var my_nav_w=piro_prev.width();main_cont.hide();var my_gall_classes=$("a[class^='pirobox']");var map=new Object();for(var i=0;i<my_gall_classes.length;i++){var it=$(my_gall_classes[i]);map["a."+it.attr("class")]=0;}var gall_settings=new Array();for(var key in map){gall_settings.push(key);}for(var i=0;i<gall_settings.length;i++){$(gall_settings[i]).each(function(rel){this.rel=rel+1+" of "+$(gall_settings[i]).length;});var add_first=$(gall_settings[i]+":first").addClass("first");var add_last=$(gall_settings[i]+":last").addClass("last");}$(my_gall_classes).each(function(rev){this.rev=rev+0;});var imgCache=$(my_gall_classes).each(function(){this.href;});var hidden=$("body").append('