Team:SYSU-China/content.html

From 2014.igem.org

(Difference between revisions)
Line 1: Line 1:
-
{{CSS/Main}}
 
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
-
<html xmlns="http://www.w3.org/1999/xhtml">
 
-
<head>
 
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
-
    <title>project sysu-china 2014</title>
 
-
    <link rel="stylesheet" type="text/css" href="https://2014.igem.org/Team:SYSU-China/css/main1.css?action=raw&amp;ctype=text/css"/>
 
-
    <!--this is js-->
 
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/lib/jquery-2.1.1.min.js?action=raw&amp;ctype=text/javascript"></script>
 
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/lib/jquery-migrate-1.2.1.min.js?action=raw&amp;ctype=text/javascript"></script>
 
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/js/project.js?action=raw&amp;ctype=text/javascript"></script>
 
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/js/hoverdelay.js?action=raw&amp;ctype=text/javascript"></script>
 
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/lib/jquery.hash.js?action=raw&amp;ctype=text/javascript"></script>
 
-
    <link href="https://2014.igem.org/Team:SYSU-China/css/flexnav.css?action=raw&amp;ctype=text/css" rel="stylesheet" type="text/css" />
 
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/js/jquery.flexnav.js?action=raw&amp;ctype=text/javascript"></script>
 
-
    <!--Picture-->
+
$(function() {
-
    <!-- Add jQuery library -->
+
var navicon = ["Project", "Judging", "HumanPractice", "Team"];
-
   
+
var urlHash = ["Project/Background", "Judging/Safetyform", "HumanPractice/iGEMCC", "Team/Ourteam"];
 +
var colors = ["#b5c90f", "#ed8f6b", "#7aa59e", "#ed9d60"];
-
    <!-- Add mousewheel plugin (this is optional) -->
+
function navigationSet() {
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/fancybox/lib/jquery.mousewheel-3.0.6.pack.js?action=raw&amp;ctype=text/javascript"></script>
+
$(".dl-menu").each(function(i) {
 +
$(this).css("background-color", colors[i]);
 +
$(this).children().each(function() {
 +
$($(this).children()[1]).css("background-color", colors[i]);
 +
});
 +
});
 +
$(".navibar img").each(function(index) {
 +
$(this).hover(function() {
 +
var newSrc = $(this).attr("src").replace("/sysuchina_bg", "/bg");
 +
$(this).attr("src", newSrc);
 +
//$(this).css({"width" : "45px", "height" : "45px"});
 +
}, function() {
 +
var newSrc = $(this).attr("src").replace("bg3/bg", "bg3/sysuchina_bg");
 +
$(this).attr("src", newSrc);
 +
//$(this).css({"width" : "40px", "height" : "40px"});
 +
}).trigger("mousehover");
-
    <!-- Add fancyBox -->
+
$(this).click(function() {
-
    <link rel="stylesheet" href="https://2014.igem.org/Team:SYSU-China/fancybox/source/jquery.fancybox.css?v=2.1.5&amp;action=raw&amp;ctype=text/css" type="text/css" media="screen" />
+
gotoTop(1);
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/fancybox/source/jquery.fancybox.pack.js&amp;v=2.1.5?action=raw&amp;ctype=text/javascript"></script>
+
var hrefhash = urlHash[index];
 +
$.locationHash(hrefhash);
 +
});
 +
});
 +
}
-
    <!-- Optionally add helpers - button, thumbnail and/or media -->
+
function fixscroll() {
-
    <link rel="stylesheet" href="https://2014.igem.org/Team:SYSU-China/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5?action=raw&amp;ctype=text/css" type="text/css" media="screen" />
+
//获取要定位元素距离浏览器顶部的距离
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5&amp;action=raw&amp;ctype=text/javascript"></script>
+
var navH = $($(".navibar")[0]).position().top;
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6&amp;action=raw&amp;ctype=text/javascript"></script>
+
var nav2H = $($(".navigation2")[0]).position().top;
-
    <link rel="stylesheet" href="https://2014.igem.org/Team:SYSU-China/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7?action=raw&amp;ctype=text/css" type="text/css" media="screen" />
+
//滚动条事件
-
    <script type="text/javascript" src="https://2014.igem.org/Team:SYSU-China/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7&amp;action=raw&amp;ctype=text/javascript"></script>
+
$(window).scroll(function(){
 +
//获取滚动条的滑动距离
 +
var scroH = $(document).scrollTop();
 +
//滚动条的滑动距离大于等于定位元素距离浏览器顶部的距离,就固定,反之就不固定
 +
if(scroH >= navH){
 +
$(".navibar").css({"position":"fixed","top":"0"});
 +
} else if(scroH < navH){
 +
$(".navibar").css({"position":"absolute", "top" : "204px"});  
 +
}
-
    <link rel="stylesheet" type="text/css" href="https://2014.igem.org/Team:SYSU-China/css/default.css?action=raw&amp;ctype=text/css" />
+
if(scroH >= nav2H){
-
        <link rel="stylesheet" type="text/css" href="https://2014.igem.org/Team:SYSU-China/css/component.css?action=raw&amp;ctype=text/css" />
+
$(".navigation2").css({"position":"fixed","top": "60px"});  
 +
} else if(scroH < nav2H){
 +
$(".navigation2").css({"position":"absolute", "top" : "264px"});  
 +
}
 +
});
 +
}
-
    <!--Picture-->
 
-
    <script src="https://2014.igem.org/Team:SYSU-China/js/modernizr.custom.js?action=raw&amp;ctype=text/javascript"></script>
 
-
    <script src="https://2014.igem.org/Team:SYSU-China/js/jquery.dlmenu.js?action=raw&amp;ctype=text/javascript"></script>
 
-
</head>
 
-
<body>
+
function stopBubble(e) {
-
    <!--this is head slide part-->
+
  // 如果提供了事件对象,则这是一个非IE浏览器
-
    <div class="single-item">
+
    if ( e && e.stopPropagation ) {
-
        <div>
+
         // 因此它支持W3C的stopPropagation()方法
-
            <img src="https://static.igem.org/mediawiki/2014/7/76/Sysuchina_project.png" alt="projectslide" width="1098"/>       
+
        e.stopPropagation();
-
         </div>
+
    } else {
-
        <div>
+
      // 否则,我们需要使用IE的方式来取消事件冒泡
-
            <img src="https://static.igem.org/mediawiki/2014/6/6a/Sysuchina_Judge.png" alt="judgingslide" width="1098"/>
+
        window.event.cancelBubble = true;
-
        </div>
+
    }
-
        <div>
+
}
-
            <img src="https://static.igem.org/mediawiki/2014/d/df/Sysuchina_humanpractice.png" alt="humanpslide" width="1098"/>
+
-
        </div>
+
-
        <div>
+
-
            <img src="https://static.igem.org/mediawiki/2014/a/a4/Sysuchina_team.png" alt="teamslide" width="1098"/>
+
-
        </div>
+
-
    </div>
+
-
        <!--Top navigation-->
+
function requestFile() {
-
    <div class="navigation">
+
var lochash = $.locationHash();
-
        <nav class = "navigation2">
+
$.get(
-
          <ul data-breakpoint="800" class="flexnav">
+
"igem.php",
-
            <li class="firstNav"><a href="#Project/Background">Project</a>
+
{ hash : lochash} ,
-
              <ul>
+
function(data){
-
                <li><a href="#Project/Background">Background</a></li>
+
//alert(data);
-
                <li><a href="#Project/Design/M13">Design</a>
+
$($(".content")[0]).html(data + "<img src=\"images/ZY/sysuchina_top.png\" alt=\"top\" id=\"top\">");
-
                  <ul>
+
top();
-
                    <li><a href="#Project/Design/Overview">Overview</a></li>
+
},
-
                    <li><a href="#Project/Design/M13">M13</a></li>
+
"html"
-
                    <li><a href="#Project/Design/Mutagenesis">Mutagenesis</a></li>
+
);
-
                    <li><a href="#Project/Design/B2H">B2H</a></li>
+
}
-
                    <li><a href="#Project/Design/RNAT">RNAT</a></li>
+
-
                  </ul>
+
-
                </li>
+
-
                <li><a href="#Project/Result/M13">Result</a>
+
-
                  <ul>
+
-
                    <li><a href="#Project/Result/RNAT">Overview</a></li>
+
-
                    <li><a href="#Project/Result/M13">M13</a></li>
+
-
                    <li><a href="#Project/Result/Mutage">Mutagenesis</a></li>
+
-
                    <li><a href="#Project/Result/B2H">B2H</a></li>
+
-
                    <li><a href="#Project/Result/RNAT">RNAT</a></li>
+
-
                    <li><a href="#Project/Result/Integration">Integration</a></li>
+
-
                  </ul>
+
-
                </li>
+
-
                <li><a href="#Project/Model/BLOSUM62">Model</a>
+
-
                  <ul>
+
-
                    <li><a href="#Project/Model/BLOSUM62">BLOSUM62</a></li>
+
-
                    <li><a href="#Project/Model/Chemicaldynamicalmodel">Chemical dynamical model</a></li>
+
-
                    <li><a href="#Project/Model/Sequenceevolutionmodel">Sequence evolution model</a></li>
+
-
                    <li><a href="#Project/Model/Populationgrowthmodel">Population growth model</a></li>
+
-
                  </ul>
+
-
                </li>
+
-
               
+
-
                <li><a href="#Project/Notebook/Protocol/M13">Notebook</a>
+
-
                    <ul>
+
-
                        <li><a href="#Project/Notebook/Protocol/M13">Protocol</a></li>
+
-
                            <ul>
+
-
                                <li><a href="#Project/Notebook/Protocol/M13">M13</a></li>
+
-
                                <li><a href="#Project/Notebook/Protocol/Mutation">Mutation</a></li>
+
-
                                <li><a href="#Project/Notebook/Protocol/B2H">B2H</a></li>
+
-
                                <li><a href="#Project/Notebook/Protocol/RNAT">RNAT</a></li>
+
-
                                <li><a href="#Project/Notebook/Protocol/TestFluorescent">Test Fluorescent</a>
+
-
                                </li>
+
-
                                <li><a href="#Project/Notebook/Protocol/Testthree">Test three</a></li>
+
-
                            </ul>   
+
-
                        <li><a href="#Project/Notebook/Labnote/M13">Lab note</a>
+
-
                            <ul>
+
-
                                <li><a href="#Project/Notebook/Labnote/M13">M13</a></li>
+
-
                                <li><a href="#Project/Notebook/Labnote/Mutation">Mutation</a></li>
+
-
                                <li><a href="#Project/Notebook/Labnote/B2H">B2H</a></li>
+
-
                                <li><a href="#Project/Notebook/Labnote/RNAT">RNAT</a></li>
+
-
                            </ul>                   
+
-
                        </li>
+
-
                    </ul>
+
-
                </li>
+
-
              </ul>
+
-
            </li>
+
-
            <li class="firstNav"><a href="#Judging/Safetyform">Judging</a>
+
function gotoTop(speed) {
-
              <ul>
+
$('body,html').animate({scrollTop:0},speed); 
-
                <li> <a href="#Judging/Safetyform">Safety form</a></li>
+
}
-
                <li><a href="#Judging/PartSubmission">Part Submission</a></li>
+
-
                <li><a href="#Judging/Achievement">Achievement</a></li>
+
-
                <li><a href="#Judging/Interlabstudy">Interlab study</a></li>
+
-
                <li><a href="#Judging/Judgingform">Judging form</a></li>
+
-
              </ul>
+
-
            </li>
+
-
            <li class="firstNav"><a href="#HumanPractice/iGEMCC">Human Practice</a>
+
function top() {
-
              <ul>
+
$("#top").click(function() {
-
                <li><a href="#HumanPractice/iGEMCC">iGEM CC</a></li>
+
gotoTop();
-
                <li><a href="#HumanPractice/iGEMconference">iGEM conference</a></li>
+
});
-
                <li><a href="#HumanPractice/Newsletter">Newsletter</a></li>
+
}
-
              </ul>
+
-
            </li>
+
-
            <li class="firstNav"><a href="#Team/Ourteam">Team</a>
+
function clickSidebar() {
-
              <ul>
+
$(".sidebar li").each(function() {
-
                <li><a href="#Team/AboutSYSUChina/Ourteam">Our team</a></li>
+
$(this).click(function() {
-
                <li><a href="#Team/AboutSYSUChina/Gallery">Gallery</a></li>
+
var hash = $.locationHash();
-
                <li><a href="#Team/AboutSYSUChina/Attribution">Attribution</a></li>
+
var title = $(this).attr("name");
-
                <li><a href="#Team/AboutSYSUChina/Acknowledgement">Acknowledgement</a></li>
+
var newhash = hash.replace(/\/[a-zA-Z,_,\s]+$/,'/' + title);
-
              </ul>
+
hashTitletitle = title;
-
            </li>
+
$.locationHash(newhash);
-
          </ul>
+
});
-
        </nav>   
+
});
-
    </div>
+
}
-
    <div class="navibar">
 
-
        <img src="https://static.igem.org/mediawiki/2014/5/5b/Sysuchina_bg31.png" alt="icon1" id="icon1">
 
-
        <img src="https://static.igem.org/mediawiki/2014/5/5e/Sysuchina_bg34.png" alt="icon2" id="icon2">
 
-
        <img src="https://static.igem.org/mediawiki/2014/7/74/Sysuchina_bg33.png" alt="icon3" id="icon3">
 
-
        <img src="https://static.igem.org/mediawiki/2014/2/27/Sysuchina_bg35.png" alt="icon5" id="icon5">
 
-
          <!--this is sidenav-->
+
function jQueryHash() { // hash change listener
-
        <div id="sidenav">
+
$(window).hashchange(function() {
-
            <div id="dl-menu" class="dl-menuwrapper">
+
/*change page position*/
-
                <button class="dl-trigger">Open Menu</button>
+
/*change file*/
-
                <!--1111111111111-->
+
requestFile();
-
                <ul class="dl-menu">
+
$('.single-item div').each(function() {
-
                    <li><a href="#">M13</a>
+
$(this).hide();
-
                        <ul class="dl-submenu">
+
});
-
                            <li><a href="#"></a></li>
+
/*change top image*/
-
                            <li><a href="#"></a></li>
+
var hash = $.locationHash();
-
                            <li><a href="#"></a></li>
+
var hashlist = hash = hash.split('/');
-
                        </ul>
+
var hashnum = hashlist.length;
-
                    </li>
+
var index = navicon.indexOf(hashlist[0]);
-
                    <li><a href="#">Mutagenesisi</a>
+
if (hash != "" && hashnum == 0) {
-
                        <ul class="dl-submenu">
+
hashlist.push(hash);
-
                            <li><a href="#">Camera &amp; Photo</a></li>
+
hashnum  = 1;
-
                            <li><a href="#"></a></li>
+
}
-
                            <li><a href="#"></a></li>
+
if (hashnum == 0) {
-
                            <li><a href="#"></a></li>
+
$($('.single-item div')[0]).show();
-
                        </ul>
+
} else {
-
                    </li>
+
if (index != -1)
-
                    <li><a href="#">B2H</a>
+
$($('.single-item div')[index]).show();
-
                        <ul class="dl-submenu">
+
}
-
                            <li><a href="#"></a></li>
+
$(".dl-menu").each(function() {
-
                            <li><a href="#"></a></li>
+
$(this).hide();
-
                            <li><a href="#"></a></li>
+
});
-
                            <li><a href="#"></a></li>
+
$($(".dl-menu")[index]).show();
-
                            <li><a href="#"></a></li>
+
$($("#sidenav button")[0]).css("background-color", colors[index]);
-
                        </ul>
+
});
-
                    </li>
+
}
-
                    <li><a href="#">RNAT</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                </ul>
+
-
                <!--2222222222222222-->
+
var showTip = false;
-
                <ul class="dl-menu">
+
-
                    <li><a href="#">M13</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">Mutagenesisi</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#">Camera &amp; Photo</a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">B2H</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">RNAT</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                </ul>               
+
-
                <!--3333333333333333-->
+
-
                <ul class="dl-menu">
+
-
                    <li><a href="#">BLOSUM62</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">Chemical dynamical model</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#">Camera &amp; Photo</a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">Sequence evolution model</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">Population growth model</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">Discussion &amp; Future work</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                </ul>
+
-
                <!--4444444444444444-->
+
-
                <ul class="dl-menu">
+
-
                    <li><a href="#">M13</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">Mutagenesisi</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#">Camera &amp; Photo</a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">B2H</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">RNAT</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                </ul>               
+
-
                <!--5555555555555555-->
+
-
                <ul class="dl-menu">
+
-
                    <li><a href="#">M13</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">Mutagenesisi</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#">Camera &amp; Photo</a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">B2H</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                    <li><a href="#">RNAT</a>
+
-
                        <ul class="dl-submenu">
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                            <li><a href="#"></a></li>
+
-
                        </ul>
+
-
                    </li>
+
-
                </ul>               
+
-
            </div><!-- /dl-menuwrapper -->
+
-
        </div>
+
function Tips() {
 +
$("#tip em").each(function(i, v) {
 +
$(this).hoverDelay({
 +
hoverDuring: 200,
 +
outDuring: 200,
 +
hoverEvent: function() {
 +
var tooltipPosTop = $(this).position().top- $("#tipImg").outerHeight();
 +
//alert(tooltipPosTop);
 +
var tooltipPosLeft = $(this).position().left;
 +
var tooltipPosLeft = tooltipPosLeft - (($("#tipImg").outerWidth()/2) - $(this).outerWidth()/2);
 +
$("#tipImg").css({ 'left': tooltipPosLeft + "px", 'top': tooltipPosTop+"px" }).animate({'opacity':'1', 'marginTop':'0'}, 500);
 +
$("#tipImg").show();
 +
},
 +
outEvent: function() {
 +
showTip = true;
 +
 +
setTimeout(function() {
 +
if (showTip) {
 +
$("#tipImg").fadeOut(100);
 +
showTip = false;// do nothing
 +
}
 +
}, 200);
 +
}
 +
});
 +
});
-
    </div>
+
$("#tipImg").hoverDelay({
 +
hoverDuring: 200,
 +
outDuring: 200,
 +
hoverEvent: function() {
 +
showTip = false;
 +
},
 +
outEvent: function() {
 +
$("#tipImg").fadeOut(100);
 +
}
 +
});
 +
}
-
    <span class="content">
+
function GT(o){T=o.offsetTop;if(o.offsetParent!=null)T+=GT(o.offsetParent);return T;}
-
        <p id="tip">I am the <em>content</em> of the project!</p>       
+
-
        <img src="https://static.igem.org/mediawiki/2014/3/3c/Sysuchina_top.png" alt="top" id="top">
+
-
    </span>
+
-
</body>
+
function GL(o){L =o.offsetLeft;if(o.offsetParent!=null)L+=GL(o.offsetParent);return L;}
-
</html>
+
 
 +
function getX(evt) {
 +
return evt.pageX;
 +
}
 +
 
 +
function getY(evt) {
 +
return evt.pageY;
 +
}
 +
 
 +
function mousePosition(ev) {
 +
if (ev.pageX || ev.pageY) {
 +
return { x: ev.pageX, y: ev.pageY };
 +
}
 +
}
 +
 
 +
function linkHome() {
 +
$(".single-item img").each(function() {
 +
$(this).click(function() {
 +
location.href = "newindex.html";
 +
});
 +
});
 +
}
 +
function imgbox() {
 +
$(".fancybox").fancybox();
 +
}
 +
 
 +
function flexnavi() {
 +
$(".flexnav").flexNav();
 +
}
 +
 
 +
var Navhover = [false, false, false, false, false];
 +
function navigation() {
 +
/* Icon hover dalay
 +
 
 +
$(".navigation img").each(function(index) {
 +
$(this).hoverDelay({
 +
hoverDuring: 20,
 +
outDuring: 20,
 +
hoverEvent: function() {
 +
$($(".firstNav")[index]).show();
 +
var newSrc = $(this).attr("src").replace("/sysuchina_bg", "/bg");
 +
$(this).attr("src", newSrc);
 +
},
 +
outEvent: function() {
 +
var newSrc = $(this).attr("src").replace("bg3/bg", "bg3/sysuchina_bg");
 +
$(this).attr("src", newSrc);
 +
setTimeout(function(){
 +
if (!Navhover) {
 +
$($(".firstNav")[index]).hide();
 +
}
 +
}, 100);
 +
 +
}
 +
});
 +
    });
 +
*/
 +
$(".navibar img").each(function(index) {
 +
$(this).hover( function() {
 +
$($(".firstNav")[index]).show();
 +
var newSrc = $(this).attr("src").replace("/sysuchina_bg", "/bg");
 +
$(this).attr("src", newSrc);
 +
}, function() {
 +
var newSrc = $(this).attr("src").replace("bg3/bg", "bg3/sysuchina_bg");
 +
$(this).attr("src", newSrc);
 +
setTimeout(function(){
 +
if (!Navhover[index]) {
 +
//$($(".firstNav")[index]).trigger("mouseleave");
 +
$($(".firstNav")[index]).hide();
 +
Navhover[index] = false;
 +
}
 +
}, 50);
 +
});
 +
    });
 +
 
 +
    $(".firstNav").each(function(index) {
 +
    $(this).hover(function() {
 +
    Navhover[index] = true;
 +
    }, function() {
 +
    Navhover[index] = false;
 +
    $($(".firstNav")[index]).hide();
 +
    }).trigger("mousehover");
 +
    });
 +
 
 +
    $(".firstNav").each(function() {
 +
$(this).hide();
 +
});
 +
 +
$(window).resize(function() {
 +
    loadJs();
 +
    //document.location.reload();
 +
});
 +
 
 +
/*
 +
    $(".navigation img").each(function(index) {
 +
$(this).hover(function() {
 +
var newSrc = $(this).attr("src").replace("/sysuchina_bg", "/bg");
 +
$(this).attr("src", newSrc);
 +
}, function() {
 +
var newSrc = $(this).attr("src").replace("bg3/bg", "bg3/sysuchina_bg");
 +
$(this).attr("src", newSrc);
 +
}).trigger("mousehover");   
 +
    });
 +
*/
 +
    }
 +
 
 +
    function loadJs(file) {
 +
$("script[src='js/jquery.flexnav.js']").remove();
 +
$.getscript("js/jquery.flexnav.js");
 +
}
 +
 
 +
function modal() {
 +
$('#myModal').reveal({
 +
    animation: 'fadeAndPop',                  //fade, fadeAndPop, none
 +
    animationspeed: 300,                      //how fast animtions are
 +
    closeonbackgroundclick: true,              //if you click background will modal close?
 +
    dismissmodalclass: 'close-reveal-modal',    //the class of a button or element that will close an open modal
 +
});
 +
}
 +
function sidenav() {
 +
$( '#dl-menu' ).dlmenu();
 +
$($("#dl-menu button")[0]).trigger("click");
 +
}
 +
 
 +
 
 +
function ini() {
 +
//alert("sd");
 +
$(".dl-menu").each(function() {
 +
$(this).hide();
 +
});
 +
$($(".dl-menu")[0]).show();
 +
 
 +
$("#tipImg").hide();
 +
 
 +
$($(".dl-menu")[0]).show();
 +
 
 +
var currentHash = $.locationHash();
 +
 
 +
//getPage();
 +
//routeTree();
 +
navigationSet();
 +
 
 +
top();
 +
jQueryHash();
 +
flexnavi();
 +
//Tips();
 +
setTimeout(fixscroll, 10);
 +
setTimeout(Tips, 50);
 +
linkHome();
 +
//imgbox();
 +
navigation();
 +
//modal();
 +
sidenav();
 +
 
 +
}
 +
 
 +
 
 +
ini();
 +
 
 +
});

Revision as of 03:46, 17 October 2014

$(function() { var navicon = ["Project", "Judging", "HumanPractice", "Team"]; var urlHash = ["Project/Background", "Judging/Safetyform", "HumanPractice/iGEMCC", "Team/Ourteam"]; var colors = ["#b5c90f", "#ed8f6b", "#7aa59e", "#ed9d60"];

function navigationSet() { $(".dl-menu").each(function(i) { $(this).css("background-color", colors[i]); $(this).children().each(function() { $($(this).children()[1]).css("background-color", colors[i]); }); }); $(".navibar img").each(function(index) { $(this).hover(function() { var newSrc = $(this).attr("src").replace("/sysuchina_bg", "/bg"); $(this).attr("src", newSrc); //$(this).css({"width" : "45px", "height" : "45px"}); }, function() { var newSrc = $(this).attr("src").replace("bg3/bg", "bg3/sysuchina_bg"); $(this).attr("src", newSrc); //$(this).css({"width" : "40px", "height" : "40px"}); }).trigger("mousehover");

$(this).click(function() { gotoTop(1); var hrefhash = urlHash[index]; $.locationHash(hrefhash); }); }); }

function fixscroll() { //获取要定位元素距离浏览器顶部的距离 var navH = $($(".navibar")[0]).position().top; var nav2H = $($(".navigation2")[0]).position().top;

//滚动条事件 $(window).scroll(function(){ //获取滚动条的滑动距离 var scroH = $(document).scrollTop(); //滚动条的滑动距离大于等于定位元素距离浏览器顶部的距离,就固定,反之就不固定 if(scroH >= navH){ $(".navibar").css({"position":"fixed","top":"0"}); } else if(scroH < navH){ $(".navibar").css({"position":"absolute", "top" : "204px"}); }

if(scroH >= nav2H){ $(".navigation2").css({"position":"fixed","top": "60px"}); } else if(scroH < nav2H){ $(".navigation2").css({"position":"absolute", "top" : "264px"}); } }); }


function stopBubble(e) { // 如果提供了事件对象,则这是一个非IE浏览器

   	if ( e && e.stopPropagation ) {
       // 因此它支持W3C的stopPropagation()方法 
       	e.stopPropagation();
   	} else { 
      	// 否则,我们需要使用IE的方式来取消事件冒泡
       	window.event.cancelBubble = true;

} }

function requestFile() { var lochash = $.locationHash(); $.get( "igem.php", { hash : lochash} , function(data){ //alert(data); $($(".content")[0]).html(data + "<img src=\"images/ZY/sysuchina_top.png\" alt=\"top\" id=\"top\">"); top(); }, "html" ); }

function gotoTop(speed) { $('body,html').animate({scrollTop:0},speed); }

function top() { $("#top").click(function() { gotoTop(); }); }

function clickSidebar() { $(".sidebar li").each(function() { $(this).click(function() { var hash = $.locationHash(); var title = $(this).attr("name"); var newhash = hash.replace(/\/[a-zA-Z,_,\s]+$/,'/' + title); hashTitletitle = title; $.locationHash(newhash); }); }); }


function jQueryHash() { // hash change listener $(window).hashchange(function() { /*change page position*/ /*change file*/ requestFile(); $('.single-item div').each(function() { $(this).hide(); }); /*change top image*/ var hash = $.locationHash(); var hashlist = hash = hash.split('/'); var hashnum = hashlist.length; var index = navicon.indexOf(hashlist[0]); if (hash != "" && hashnum == 0) { hashlist.push(hash); hashnum = 1; } if (hashnum == 0) { $($('.single-item div')[0]).show(); } else { if (index != -1) $($('.single-item div')[index]).show(); } $(".dl-menu").each(function() { $(this).hide(); }); $($(".dl-menu")[index]).show(); $($("#sidenav button")[0]).css("background-color", colors[index]); }); }

var showTip = false;

function Tips() { $("#tip em").each(function(i, v) { $(this).hoverDelay({ hoverDuring: 200, outDuring: 200, hoverEvent: function() { var tooltipPosTop = $(this).position().top- $("#tipImg").outerHeight(); //alert(tooltipPosTop); var tooltipPosLeft = $(this).position().left; var tooltipPosLeft = tooltipPosLeft - (($("#tipImg").outerWidth()/2) - $(this).outerWidth()/2);

$("#tipImg").css({ 'left': tooltipPosLeft + "px", 'top': tooltipPosTop+"px" }).animate({'opacity':'1', 'marginTop':'0'}, 500); $("#tipImg").show(); }, outEvent: function() { showTip = true;

setTimeout(function() { if (showTip) { $("#tipImg").fadeOut(100); showTip = false;// do nothing } }, 200); } }); });

$("#tipImg").hoverDelay({ hoverDuring: 200, outDuring: 200, hoverEvent: function() { showTip = false; }, outEvent: function() { $("#tipImg").fadeOut(100); } }); }

function GT(o){T=o.offsetTop;if(o.offsetParent!=null)T+=GT(o.offsetParent);return T;}

function GL(o){L =o.offsetLeft;if(o.offsetParent!=null)L+=GL(o.offsetParent);return L;}

function getX(evt) { return evt.pageX; }

function getY(evt) { return evt.pageY; }

function mousePosition(ev) { if (ev.pageX || ev.pageY) { return { x: ev.pageX, y: ev.pageY }; } }

function linkHome() { $(".single-item img").each(function() { $(this).click(function() { location.href = "newindex.html"; }); }); } function imgbox() { $(".fancybox").fancybox(); }

function flexnavi() { $(".flexnav").flexNav(); }

var Navhover = [false, false, false, false, false]; function navigation() { /* Icon hover dalay

$(".navigation img").each(function(index) { $(this).hoverDelay({ hoverDuring: 20, outDuring: 20, hoverEvent: function() { $($(".firstNav")[index]).show(); var newSrc = $(this).attr("src").replace("/sysuchina_bg", "/bg"); $(this).attr("src", newSrc); }, outEvent: function() { var newSrc = $(this).attr("src").replace("bg3/bg", "bg3/sysuchina_bg"); $(this).attr("src", newSrc); setTimeout(function(){ if (!Navhover) { $($(".firstNav")[index]).hide(); } }, 100);

} });

   	});

*/ $(".navibar img").each(function(index) { $(this).hover( function() { $($(".firstNav")[index]).show(); var newSrc = $(this).attr("src").replace("/sysuchina_bg", "/bg"); $(this).attr("src", newSrc); }, function() { var newSrc = $(this).attr("src").replace("bg3/bg", "bg3/sysuchina_bg"); $(this).attr("src", newSrc); setTimeout(function(){ if (!Navhover[index]) { //$($(".firstNav")[index]).trigger("mouseleave"); $($(".firstNav")[index]).hide(); Navhover[index] = false; } }, 50); });

   	});
   	$(".firstNav").each(function(index) {
   		$(this).hover(function() {
   			Navhover[index] = true;
   		}, function() {
   			Navhover[index] = false;
   			$($(".firstNav")[index]).hide();
   		}).trigger("mousehover");
   	});
   	$(".firstNav").each(function() {

$(this).hide(); });

$(window).resize(function() {

   		loadJs();
   		//document.location.reload();

});

/*

   	$(".navigation img").each(function(index) {

$(this).hover(function() { var newSrc = $(this).attr("src").replace("/sysuchina_bg", "/bg"); $(this).attr("src", newSrc); }, function() { var newSrc = $(this).attr("src").replace("bg3/bg", "bg3/sysuchina_bg"); $(this).attr("src", newSrc); }).trigger("mousehover");

   	});
  • /
   }
   function loadJs(file) {

$("script[src='js/jquery.flexnav.js']").remove(); $.getscript("js/jquery.flexnav.js"); }

function modal() { $('#myModal').reveal({

   		animation: 'fadeAndPop',                   //fade, fadeAndPop, none
   		animationspeed: 300,                       //how fast animtions are
   		closeonbackgroundclick: true,              //if you click background will modal close?
   		dismissmodalclass: 'close-reveal-modal',    //the class of a button or element that will close an open modal

}); } function sidenav() { $( '#dl-menu' ).dlmenu(); $($("#dl-menu button")[0]).trigger("click"); }


function ini() { //alert("sd"); $(".dl-menu").each(function() { $(this).hide(); }); $($(".dl-menu")[0]).show();

$("#tipImg").hide();

$($(".dl-menu")[0]).show();

var currentHash = $.locationHash();

//getPage(); //routeTree(); navigationSet();

top(); jQueryHash(); flexnavi(); //Tips(); setTimeout(fixscroll, 10); setTimeout(Tips, 50); linkHome(); //imgbox(); navigation(); //modal(); sidenav();

}


ini();

});