Team:SYSU-China/Team/Member style.js

From 2013.igem.org

(Difference between revisions)
Line 4: Line 4:
$("div.inner_frame").stop();
$("div.inner_frame").stop();
$("div.flash_button").stop();
$("div.flash_button").stop();
-
$(this).parent().animate({width: 450},200,function(){
+
$(this).parent().children("div.inner_frame").animate({width: 450},200,function(){
$(this).css({"background":"url(https://static.igem.org/mediawiki/2013/3/39/Stein_00.png) no-repeat 80% 20%"});
$(this).css({"background":"url(https://static.igem.org/mediawiki/2013/3/39/Stein_00.png) no-repeat 80% 20%"});
$(this).animate({left:'+=3px'},10);
$(this).animate({left:'+=3px'},10);
Line 20: Line 20:
$(this).animate({top:'-=3px'},10,function(){
$(this).animate({top:'-=3px'},10,function(){
$(this).css({"background":"none"});
$(this).css({"background":"none"});
-
$(this).parent().animate({width: 0},200);
+
$(this).parent().children("div.inner_frame").animate({width: 450},200)
});
});
});
});
});
});

Revision as of 02:00, 26 September 2013

$(document).ready(function(){

$("div.flash_button").mouseenter(function(){ $("div.inner_frame").stop(); $("div.flash_button").stop(); $(this).parent().children("div.inner_frame").animate({width: 450},200,function(){ $(this).css({"background":"url(Stein_00.png) no-repeat 80% 20%"}); $(this).animate({left:'+=3px'},10); $(this).animate({left:'-=3px'},10); $(this).animate({top:'+=3px'},10); $(this).animate({top:'-=3px'},10); }); }); $("div.flash_button").mouseout(function(){ $("div.inner_frame").stop(); $("div.flash_button").stop(); $(this).animate({left:'+=3px'},10); $(this).animate({left:'-=3px'},10); $(this).animate({top:'+=3px'},10); $(this).animate({top:'-=3px'},10,function(){ $(this).css({"background":"none"}); $(this).parent().children("div.inner_frame").animate({width: 450},200) }); }); });