Team:Peking/js/home.js

From 2014.igem.org

(Difference between revisions)
 
(13 intermediate revisions not shown)
Line 8: Line 8:
$("#pabstract").stop().slideUp("1000");
$("#pabstract").stop().slideUp("1000");
  });
  });
-
 
  jumpupposition();
  jumpupposition();
$('#jumpup').hover(function(){
$('#jumpup').hover(function(){
  $("#jumpup img").attr({"src":"https://static.igem.org/mediawiki/2014/b/bd/Peking2014wcg_jumpupchoose.png"});
  $("#jumpup img").attr({"src":"https://static.igem.org/mediawiki/2014/b/bd/Peking2014wcg_jumpupchoose.png"});
-
               
+
                            },function(){
-
                var right=($("body").width()-$("#mainbody").width())/4;
+
  $("#jumpup img").attr({"src":"https://static.igem.org/mediawiki/2014/4/48/Peking2014wcg_jumpup.png"}); });
-
+
-
  $("#jumpup").attr("right",right);
+
-
$("#jumpdown").attr("right",right);
+
-
alert(right);
+
-
                      },function(){
+
-
  $("#jumpup img").attr({"src":"https://static.igem.org/mediawiki/2014/4/48/Peking2014wcg_jumpup.png"});
+
-
                        });
+
$('#jumpdown').hover(function(){
$('#jumpdown').hover(function(){
  $("#jumpdown img").attr({"src":"https://static.igem.org/mediawiki/2014/5/5b/Peking2014wcg_jumpdownchoose.png"});
  $("#jumpdown img").attr({"src":"https://static.igem.org/mediawiki/2014/5/5b/Peking2014wcg_jumpdownchoose.png"});
Line 30: Line 22:
-
 
function mid1size()
function mid1size()
Line 51: Line 42:
{
{
-
var h=$("#mid2right").height()-100;
+
var h=$("#mid2right").height()-180;
-
$("#mid2center img").css("height",h);
+
                var w=$("#mid2center img").width();
-
//alert(h);     
+
$("#mid2center img").css("height",703);
 +
//alert(h+":+w:"+w);     
};
};
Line 59: Line 51:
function jumpupposition()
function jumpupposition()
{
{
-
var right=($("body").width()-$("#mainbody").width())/4;
+
var right=($("body").width()-$("#mainbody").width())/2-80;  
-
alert("down;"+$("#jumpdown").attr("right"));
+
  if(right<0){
-
alert("up;"+$("#jumpup").attr("right"));
+
      right=0;
-
   $("#jumpup").attr("right",right);
+
                }
-
$("#jumpdown").attr("right",right);
+
   $("#jumpup").css('right',right);
-
alert(right);     
+
$("#jumpdown").css('right',right);
 +
//alert(right);     
};
};

Latest revision as of 22:31, 17 October 2014

$(document).ready(function(){ mid1size(); mid2size(); $("#mid1left").mouseover(function(){ $("#pabstract").stop().slideDown("1000"); }); $("#mid1left").mouseout(function(){ $("#pabstract").stop().slideUp("1000"); });

		jumpupposition();

$('#jumpup').hover(function(){ $("#jumpup img").attr({"src":"Peking2014wcg_jumpupchoose.png"});

                           },function(){

$("#jumpup img").attr({"src":"Peking2014wcg_jumpup.png"}); }); $('#jumpdown').hover(function(){ $("#jumpdown img").attr({"src":"Peking2014wcg_jumpdownchoose.png"});

                     },function(){

$("#jumpdown img").attr({"src":"Peking2014wcg_jumpdown.png"});

                        });

});


function mid1size() {

var w=$("#mid1left").width(); var h=w*480/640; $("#mid1left").css("height",h); $("#mid1right").css("height",h); // alert(height);

var w=$("#mid1right").width(); $(".SliderName_2 ").css("width",w); $(".SliderName_2 ").css("height",h); $(".SliderNamePrev_2").css("height",h); $(".SliderNameNext_2").css("height",h); };

function mid2size() {

var h=$("#mid2right").height()-180;

               var w=$("#mid2center img").width();

$("#mid2center img").css("height",703); //alert(h+":+w:"+w);

};

function jumpupposition() { var right=($("body").width()-$("#mainbody").width())/2-80;

 		if(right<0){
 		    right=0;
               }
 		$("#jumpup").css('right',right);

$("#jumpdown").css('right',right); //alert(right);

};