Template:ArborVitae

From 2012hs.igem.org

(Difference between revisions)
Line 5: Line 5:
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
-
<script type="text/javascript" src="http://2011.igem.org/Template:Team:ArborVitae/regex.js?action=raw"></script>
 
-
<script>
 
-
//jQuery.noConflict();
 
-
 
+
);($contentbox.outerWidth());
-
jQuery.extend(jQuery.easing,
+
-
{
+
-
  easeOutBack:function(x,t,b,c,d,s)
+
-
 
+
-
  {
+
-
      if(s==undefined)
+
-
            s=1.70158;
+
-
 
+
-
      return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;
+
-
  }
+
-
}
+
-
)
+
-
 
+
-
var barheight=0;
+
-
var currenttarget=null;
+
-
var thispagenumber=0;
+
-
var $menulinks=null;
+
-
var colorsarray=["#fff","#FF7722","#bb66ff","#12aeef","#EE3333","#EEEE33", "#BA5FAB", "#33ee33"];
+
-
var linkcolorsarray=["#33ff33","#FF7722","#bb66ff","#12aeef","#FFFFFF","#EEEE33", "#BA5FAB", "#33ee33"];
+
-
 
+
-
var contentarray=[
+
-
verview</a></li><li><a href='http://2011.igem.org/Team:UC_Davis/Sponsors'>Our Sponsors</a></li></ul>",
+
-
 
+
-
 
+
-
      top:$menulinks.eq(0).position().top,
+
-
      width:$menulinks.eq(thispagenumber).parent().outerWidth(),
+
-
      height:$menulinks.eq(0).outerHeight(),
+
-
      zIndex:0
+
-
  }
+
-
  ).appendTo($menu);
+
-
 
+
-
barheight=$menulinks.eq(0).outerHeight();
+
-
$effectref.css(
+
-
{
+
-
  left:$menulinks.eq(thispagenumber).position().left
+
-
}
+
-
);
+
-
 
+
-
if(typeof setting.selectitem!="undefined")
+
-
{
+
-
  var $selectedlink=$menulinks.removeClass('selected').eq(setting.selectitem).addClass('selected');
+
-
}
+
-
 
+
-
else
+
-
{
+
-
  var $selectedlink=$menulinks.filter('.selected:eq(0)');
+
-
  var $selectedlink=$menulinks.eq(1);
+
-
}
+
-
 
+
-
setting.defaultselectedBool=$selectedlink.length;$menulinks.mouseover(function()
+
-
{
+
-
  var $target=$(this);
+
-
  if(currenttarget!=$target)
+
-
  {
+
-
      clearTimeout(setting.snapbacktimer);
+
-
      $contentbox.html(contentarray[$target.parent().index()]);
+
-
      var contentwidth = $contentbox.width();
+
-
      currenttarget=$target;$contentbox.dequeue().css(
+
-
        {
+
-
            left:$target.parent().position().left-(contentwidth-$target.parent().width())/2,opacity:0
+
-
        }
+
-
        );
+
-
      var $contentlinks=$contentbox.find('a');
+
-
      $contentlinks.hover(function()
+
-
      {
+
-
        $(this).css({color:colorsarray[$target.parent().index()]
+
-
      }
+
-
      );
+
-
 
+
-
  },
+
-
  function(){$(this).css({color:'#aaa'});
+
-
}
+
-
)
+
-
 
+
-
$contentbox.dequeue().animate({opacity:1},setting.fxtime*4,setting.fx);
+
-
var newwidth = ($target.parent().outerWidth() > $contentbox.outerWidth())?($target.parent().outerWidth()):($contentbox.outerWidth());
+
$effectref.dequeue().animate(
$effectref.dequeue().animate(
{
{
Line 92: Line 13:
   width:newwidth,
   width:newwidth,
-
  left:$target.parent().position().left-(newwidth-$target.parent().outerWidth())/2,
 
-
 
-
  height:$contentbox.outerHeight()+$menulinks.eq(0).outerHeight()},setting.fxtime,setting.fx);
 
-
 
-
  $target.dequeue().animate({color:colorsarray[$target.parent().index()]},
 
-
 
-
  setting.fxtime,setting.fx);
 
-
 
-
if(setting.defaultselectedBool==0)
 
-
  $selectedlink=$target;
 
-
}})
 
-
 
-
$menulinks.mouseleave(function(){
 
-
  var $target=$(this);if($menulinks.index(this)!=thispagenumber)
 
-
  $target.dequeue().animate({color:'#aaa'},setting.fxtime,setting.fx);
 
-
  }
 
-
  )
 
-
 
-
if($selectedlink.length>0)
 
-
{
 
-
  snapback(0);
 
-
  $('#navcon').mouseleave(function()
 
-
  {
 
-
      currenttarget=$menulinks.eq(thispagenumber);
 
-
      setting.snapbacktimer=setTimeout(function(){$effectref.dequeue().animate(
 
-
      {
 
-
        height:barheight,
 
-
        width:currenttarget.parent().outerWidth(),
 
-
        left:currenttarget.position().left},
 
-
        setting.fxtime,setting.fx);
 
-
        $contentbox.stop(true,true).css({opacity:0})
 
-
      },
 
-
      setting.snapdelay)
 
-
  }
 
-
  )
 
-
}
 
-
 
-
$(window).bind('resize',function(){snapback(setting.fxtime);})})}}
 
-
 
-
$(document).ready(function() {
 
-
window.$  = jQuery;
 
-
$('#linktable td').click(function(){
 
-
    window.location = "http://2011.igem.org/Team:UC_Davis/Notebook/Week_" + $(this).text();
 
-
});
 
-
var urlpieces = window.location.href.split('/');
 
-
if(urlpieces[urlpieces.length-2] == 'Notebook')
 
-
{
 
-
    var weeknum = urlpieces[urlpieces.length-1].split('_');
 
-
    weeknum = parseInt(weeknum[1]);
 
-
    if(weeknum)
 
-
    {
 
-
        $('#linktable td').eq(weeknum-1).mouseover().unbind();
 
-
    }
 
-
}
 
$('.floatbox a').css('color', linkcolorsarray[thispagenumber]);
$('.floatbox a').css('color', linkcolorsarray[thispagenumber]);
$('.sponsorfloat a').css('color', linkcolorsarray[thispagenumber]);
$('.sponsorfloat a').css('color', linkcolorsarray[thispagenumber]);

Revision as of 23:54, 21 March 2012

);($contentbox.outerWidth()); $effectref.dequeue().animate( { width:newwidth, $('.floatbox a').css('color', linkcolorsarray[thispagenumber]); $('.sponsorfloat a').css('color', linkcolorsarray[thispagenumber]); $('.floatbox *').replaceText(/(Bba\_)/gi, ''); $('.floatbox *').replaceText(/\b([A-Z]\d{4,})\b/gi, 'BBa_$1'); $('.floatbox *').replaceText(/\b(pSB\d[A-Z]+\d)\b/gi, '$1'); });