Team:HUST-China/Common.js

From 2014.igem.org

/*Navigater start*/ $(document).ready(function(){$("div.navigater").html('##<A href="https://2013.igem.org/Team:SYSU-China">Home</A>

    1. <A href="https://2013.igem.org/Team:SYSU-China/Project">PROJECT</A> ##<A href="https://2013.igem.org/Team:SYSU-China/Project/Overview">Overview</A>
    2. <A href="https://2013.igem.org/Team:SYSU-China/Project?#h2_0">Background</A>
    3. <A href="https://2013.igem.org/Team:SYSU-China/Project/Design">Design</A>
    4. <A href="https://2013.igem.org/Team:SYSU-China/Project/Results">Results</A>
    5. <A href="https://2013.igem.org/Team:SYSU-China/Project/Future_work">Future work</A>
    6. <A href="https://2013.igem.org/Team:SYSU-China/Project/Modeling">Modeling</A>
    1. <A href="">JUDGING</A> ##<A href="https://2013.igem.org/Team:SYSU-China/Judging/Biobrick">Biobrick</A>
    2. <A href="https://2013.igem.org/Team:SYSU-China/Judging/Achievements">Achievements</A>
    1. <A href="">SAFETY</A> ##<A href="https://2013.igem.org/Team:SYSU-China/Safety">Safety</A>
    2. <A href="https://2013.igem.org/Team:SYSU-China/Safety/Ethics">Ethics</A>
    3. <A href="https://2013.igem.org/Team:SYSU-China/Safety/Human practice">Human practice</A>
    1. <A href="">NOTEBOOK</A> ##<A href="https://2013.igem.org/Team:SYSU-China/Notebookt/Methods">Methods</A>
    2. <A href="https://2013.igem.org/Team:SYSU-China/Notebook/Labnotes">Labnotes</A>
    1. <A href="">TEAM</A> ##<A href="https://2013.igem.org/Team:SYSU-China/Team/Member">Member</A>
    2. <A href="https://2013.igem.org/Team:SYSU-China/Team/Attribution">Attributions</A>
    3. <A href="https://2013.igem.org/Team:SYSU-China/Team/Gallery">Gallery</A>
    4. <A href="https://2013.igem.org/Team:SYSU-China/Team/Acknowledgements">Acknowledgment</A>

')}); /*Navigater End*/

/* Reference Anchor Start */

$(document).ready(function(){ anchor_quote = $(".quote"); anchor_name = 0; anchor_quote.each(function() { var refer_num = $(this).text(); anchor_name += 1; $(this).attr({"href":"#R"+anchor_name, "name":"Q"+anchor_name}); $(".references:contains("+refer_num+")").each(function(){ $(this).attr({"href":"#Q"+anchor_name, "name":"R"+anchor_name}) }); }); });

/* Reference Anchor End */

/* Figure function Start */

$(function(){

              $("div#bodyContent").css({"background-image":"url(Logo-2013-SYSU-CHINA.png) 90% 1%;"});


$(".fig_img").click(function(){ var _this = $(this); imgShow("#outerdiv", "#innerdiv", "#bigimg", _this); }); });

function imgShow(outerdiv, innerdiv, bigimg, _this){ var src = _this.attr("src");//get the src from fig_img $(bigimg).attr("src", src);//value to #bigimg

/*get the full size & show in the new layer*/ $("<img/>").attr("src", src).load(function(){ var windowW = $(window).width(); var windowH = $(window).height(); var realWidth = this.width; var realHeight = this.height; var imgWidth, imgHeight; var scale = 0.8;//zoom it if the img size larger than the window's

if(realHeight>windowH*scale) { imgHeight = windowH*scale; imgWidth = imgHeight/realHeight*realWidth; if(imgWidth>windowW*scale) { imgWidth = windowW*scale; } } else if(realWidth>windowW*scale) { imgWidth = windowW*scale;

                      imgHeight = imgWidth/realWidth*realHeight;


} else { imgWidth = realWidth; imgHeight = realHeight; }

              $(bigimg).css("width",imgWidth);


var w = (windowW-imgWidth)/2; var h = (windowH-imgHeight)/2; $(innerdiv).css({"top":h, "left":w}); $(outerdiv).fadeIn("fast");//fade in speed for #outerdiv & fig_img });

$(outerdiv).click(function(){ $(this).fadeOut("fast"); }); }

/* Figure function End */ /* results guide start */ $(document).ready(function(){ $("a.guide_button , a.guide_button2").mouseover(function(){ $(this).animate({left:'+=15px'},10); $(this).animate({left:'-=15px'},10); $(this).animate({top:'+=15px'},10); $(this).animate({top:'-=15px'},10); }); }); /* results guide end */