Template:Team:HokkaidoU Japan/HumanPractice/script

From 2011.igem.org

(Difference between revisions)
 
(14 intermediate revisions not shown)
Line 1: Line 1:
-
<html><script src="text/javascript">
+
<html>
-
(function(a){a.fn.lightbox_me=function(b){return this.each(function(){var e=a.extend({},a.fn.lightbox_me.defaults,b),l=a(),k=a(this),m=a('<iframe id="foo" style="z-index: '+(e.zIndex+1)+';border: none; margin: 0; padding: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0; filter: mask();"/>'),g=(a.browser.msie&&a.browser.version<7);if(e.showOverlay){var f=a(".js_lb_overlay:visible");if(f.length>0){l=a('<div class="lb_overlay_clear js_lb_overlay"/>')}else{l=a('<div class="'+e.classPrefix+'_overlay js_lb_overlay"/>')}}if(g){var d=/^https/i.test(window.location.href||"")?"javascript:false":"about:blank";m.attr("src",d);a("body").append(m)}a("body").append(k.hide()).append(l);if(e.showOverlay){h();l.css({position:"absolute",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:(e.zIndex+2),display:"none"});if(!l.hasClass("lb_overlay_clear")){l.css(e.overlayCSS)}}if(e.showOverlay){l.fadeIn(e.overlaySpeed,function(){c();k[e.appearEffect](e.lightboxSpeed,function(){h();c();e.onLoad()})})}else{c();k[e.appearEffect](e.lightboxSpeed,function(){e.onLoad()})}if(e.parentLightbox){e.parentLightbox.fadeOut(200)}a(window).resize(h).resize(c).scroll(c).keyup(j);if(e.closeClick){l.click(function(n){i();n.preventDefault})}k.delegate(e.closeSelector,"click",function(n){i();n.preventDefault()});k.bind("close",i);k.bind("reposition",c);function i(){var n=k[0].style;if(e.destroyOnClose){k.add(l).remove()}else{k.add(l).hide()}if(e.parentLightbox){e.parentLightbox.fadeIn(200)}m.remove();k.undelegate(e.closeSelector,"click");a(window).unbind("reposition",h);a(window).unbind("reposition",c);a(window).unbind("scroll",c);a(document).unbind("keyup",j);if(g){n.removeExpression("top")}e.onClose()}function j(n){if((n.keyCode==27||(n.DOM_VK_ESCAPE==27&&n.which==0))&&e.closeEsc){i()}}function h(){if(a(window).height()<a(document).height()){l.css({height:a(document).height()+"px"});m.css({height:a(document).height()+"px"})}else{l.css({height:"100%"});if(g){a("html,body").css("height","100%");m.css("height","100%")}}}function c(){var o=k[0].style;k.css({left:"50%",marginLeft:(k.outerWidth()/2)*-1,zIndex:(e.zIndex+3)});if((k.height()+80>=a(window).height())&&(k.css("position")!="absolute"||g)){var n=a(document).scrollTop()+40;k.css({position:"absolute",top:n+"px",marginTop:0});if(g){o.removeExpression("top")}}else{if(k.height()+80<a(window).height()){if(g){o.position="absolute";if(e.centered){o.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');o.marginTop=0}else{var p=(e.modalCSS&&e.modalCSS.top)?parseInt(e.modalCSS.top):0;o.setExpression("top","((blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+p+') + "px"')}}else{if(e.centered){k.css({position:"fixed",top:"50%",marginTop:(k.outerHeight()/2)*-1})}else{k.css({position:"fixed"}).css(e.modalCSS)}}}}}})};a.fn.lightbox_me.defaults={appearEffect:"fadeIn",appearEase:"",overlaySpeed:250,lightboxSpeed:300,closeSelector:".close",closeClick:true,closeEsc:true,destroyOnClose:false,showOverlay:true,parentLightbox:false,onLoad:function(){},onClose:function(){},classPrefix:"lb",zIndex:999,centered:false,modalCSS:{top:"40px"},overlayCSS:{background:"black",opacity:0.3}}})(jQuery);
+
-
</script>
+
<script type="text/javascript">
<script type="text/javascript">
$(function(){
$(function(){
     $('span.footnote > a').bind('click', function(){
     $('span.footnote > a').bind('click', function(){
         var url = $(this).attr('href');
         var url = $(this).attr('href');
-
         var box = $('<div>').addClass('footnote-box').load(url + ' div#bodyContent', function(data){
+
         var title = $(this).text();
 +
        $('<div>').load(url + ' div#bodyContent', function(data){
 +
            var $box = $('<div>').addClass('footnote-box').append($('<h2>').append(title));
             var $footnote = $(data).find('div#contentSub').nextAll('p');
             var $footnote = $(data).find('div#contentSub').nextAll('p');
-
             $(this).append($footnote);
+
             $box.append($('<div>').append($footnote).addClass('footnote-content'));
-
            console.log($footnote);
+
             $('body').append($box);
-
             $('body').append($(this));
+
             $box.append($('<span>').addClass('close').addClass('close-btn-32')).lightbox_me({
-
             $(this).append($('<span>').addClass('close').addClass('close-btn-32')).lightbox_me({
+
                 destroyOnClose : true,
-
                 destroyOnClose : true
+
                modalCSS      : { 'top' : '100px' }
             });
             });
         });
         });
Line 20: Line 20:
</script>
</script>
<style>
<style>
-
div.footnote-box {
 
-
  background-color: #d9d9d9;
 
-
  margin 0 auto;
 
-
  display: block;
 
-
  padding: 50px 30px;
 
-
  width: 40%;
 
-
  height: 40%;
 
-
  overflow: scroll;
 
-
}
 
.close-btn-32 {
.close-btn-32 {
   display: block;
   display: block;
Line 65: Line 56:
   line-height: 32px;
   line-height: 32px;
   font-family: "Helvetica Neue", Consolas, Verdana, Tahoma, Calibri, Helvetica, Menlo, "Droid Sans", sans-serif;
   font-family: "Helvetica Neue", Consolas, Verdana, Tahoma, Calibri, Helvetica, Menlo, "Droid Sans", sans-serif;
 +
}
 +
div.footnote-box {
 +
  background: rgb(125,126,125);
 +
  background: -moz-linear-gradient(top, rgba(125,126,125,0.85) 0%, rgba(14,14,14,0.85) 100%);
 +
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(125,126,125,0.85)), color-stop(100%,rgba(14,14,14,0.85)));
 +
  background: -webkit-linear-gradient(top, rgba(125,126,125,0.85) 0%,rgba(14,14,14,0.85) 100%);
 +
  background: -o-linear-gradient(top, rgba(125,126,125,0.85) 0%,rgba(14,14,14,0.85) 100%);
 +
  background: -ms-linear-gradient(top, rgba(125,126,125,0.85) 0%,rgba(14,14,14,0.85) 100%);
 +
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7d7e7d', endColorstr='#0e0e0e',GradientType=0 );
 +
  background: linear-gradient(top, rgba(125,126,125,0.85) 0%,rgba(14,14,14,0.85) 100%);
 +
  margin 0 auto;
 +
  border: 3px solid #dfdfdf;
 +
  border-radius: 10px;
 +
  -moz-border-radius: 10px;
 +
  -webkit-border-radius: 10px;
 +
  display: block;
 +
  padding: 20px 20px;
 +
  width: 60%;
 +
  min-width: 650px;
 +
  height: auto;
 +
  max-height: 60%;
 +
  overflow: auto;
 +
  box-shadow: 3px 3px 5px #333;
 +
  -moz-box-shadow: 3px 3px 5px #333;
 +
  -webkit-box-shadow: 3px 3px 5px #333;
 +
}
 +
.footnote-box div.footnote-content {
 +
  color: #fefefe;
 +
  font-size: large !important;
 +
  margin: 0px auto 10px;
 +
  width: 80%;
 +
  height: 100%;
 +
}
 +
.footnote-box h2 {
 +
  color: #fefefe;
 +
  height : 80%;
 +
  margin-bottom: 10px;
 +
  border-bottom-width: 5px;
 +
  padding-left: 8px;
 +
  padding-bottom: 3px;
 +
  font-size: 250%;
 +
  text-align: center;
}
}
</style>
</style>
-
 
</html>
</html>

Latest revision as of 03:47, 6 October 2011