User:KazutoIKEDA/wiki/change-image.js

From 2009.igem.org

(Difference between revisions)
Line 1: Line 1:
$(document).ready( function() {
$(document).ready( function() {
-
  $("#biomario .thumbnail img")
+
$("#biomario .thumbnail a")
-
  // マウスオーバー・マウスアウト時
+
.hover(  
-
  .hover(  
+
function(){
-
    function(){// マウスオーバー時
+
$(this).fadeTo(200, 0.8);
-
      $(this).fadeTo(200, 0.8);
+
},function(){
-
    },
+
$(this).fadeTo(600, 1.0);
-
    function(){// マウスアウト時
+
}
-
      $(this).fadeTo(600, 1.0);
+
)
-
    }
+
.click(
-
  );
+
function() {
-
  // クリック時の処理
+
$("#biomario .target img").attr("src", $(this).attr("href"));
-
  .click( function(){
+
return false;
-
    var changeSrc  = $(this).attr("href");
+
}
-
    $("#biomario .target img").attr("src", changeSrc);
+
);
-
    return false;
+
$("#cocktail .thumbnail a")
-
  });
+
.hover(  
-
 
+
function(){
-
  $("#cocktail .thumbnail img")
+
$(this).fadeTo(200, 0.8);
-
  // マウスオーバー・マウスアウト時
+
},function(){
-
  .hover(  
+
$(this).fadeTo(600, 1.0);
-
    function(){// マウスオーバー時
+
}
-
      $(this).fadeTo(200, 0.8);
+
)
-
    },
+
.click(
-
    function(){// マウスアウト時
+
function() {
-
      $(this).fadeTo(600, 1.0);
+
$("#cocktail .target img").attr("src", $(this).attr("href"));
-
    }
+
return false;
-
  );
+
}
-
  // クリック時の処理
+
);
-
  .click( function() {
+
-
    var changeSrc  = jQuery(this).attr("href");
+
-
    $("#cocktail .target img").attr("src", changeSrc);
+
-
    return false;
+
-
  });
+
-
 
+
  $("#mandala .thumbnail a")
  $("#mandala .thumbnail a")
.hover(  
.hover(  
Line 48: Line 42:
}
}
);
);
-
 
+
$("#pyramid .thumbnail a")
-
  $("#pyramid .thumbnail img")
+
.hover(  
-
  // マウスオーバー・マウスアウト時
+
function(){
-
  .hover(  
+
$(this).fadeTo(200, 0.8);
-
    function(){// マウスオーバー時
+
},function(){
-
      $(this).fadeTo(200, 0.8);
+
$(this).fadeTo(600, 1.0);
-
    },
+
}
-
    function(){// マウスアウト時
+
)
-
      $(this).fadeTo(600, 1.0);
+
.click(
-
    }
+
function() {
-
  );
+
$("#pyramid .target img").attr("src", $(this).attr("href"));
-
  // クリック時の処理
+
return false;
-
  .click( function() {
+
}
-
    var changeSrc  = jQuery(this).attr("href");
+
);
-
    $("#pyramid .target img").attr("src", changeSrc);
+
$("#tomb .thumbnail a")
-
    return false;
+
.hover(  
-
  });
+
function(){
-
 
+
$(this).fadeTo(200, 0.8);
-
  $("#tomb .thumbnail img")
+
},function(){
-
  // マウスオーバー・マウスアウト時
+
$(this).fadeTo(600, 1.0);
-
  .hover(  
+
}
-
    function(){// マウスオーバー時
+
)
-
      $(this).fadeTo(200, 0.8);
+
.click(
-
    },
+
function() {
-
    function(){// マウスアウト時
+
$("#tomb .target img").attr("src", $(this).attr("href"));
-
      $(this).fadeTo(600, 1.0);
+
return false;
-
    }
+
}
-
  );
+
);
-
  // クリック時の処理
+
$("#bunny .thumbnail a")
-
  .click( function() {
+
.hover(  
-
    var changeSrc  = jQuery(this).attr("href");
+
function(){
-
    $("#tomb .target img").attr("src", changeSrc);
+
$(this).fadeTo(200, 0.8);
-
    return false;
+
},function(){
-
  });
+
$(this).fadeTo(600, 1.0);
-
 
+
}
-
  $("#bunny .thumbnail img")
+
)
-
  // マウスオーバー・マウスアウト時
+
.click(
-
  .hover(  
+
function() {
-
    function(){// マウスオーバー時
+
$("#bunny .target img").attr("src", $(this).attr("href"));
-
      $(this).fadeTo(200, 0.8);
+
return false;
-
    },
+
}
-
    function(){// マウスアウト時
+
);
-
      $(this).fadeTo(600, 1.0);
+
}):
-
    }
+
-
  );
+
-
  // クリック時の処理
+
-
  .click( function() {
+
-
    $("#bunny .target img").attr("src", $(this).attr("href"));
+
-
    return false;
+
-
  });
+
-
});
+

Revision as of 11:28, 21 October 2009

$(document).ready( function() {
 	$("#biomario .thumbnail a")
		.hover( 
			function(){
				$(this).fadeTo(200, 0.8);
			},function(){
				$(this).fadeTo(600, 1.0);
			}
		)
			.click(
				function() {
					$("#biomario .target img").attr("src", $(this).attr("href"));
					return false;
				}
			);
 	$("#cocktail .thumbnail a")
		.hover( 
			function(){
				$(this).fadeTo(200, 0.8);
			},function(){
				$(this).fadeTo(600, 1.0);
			}
		)
			.click(
				function() {
					$("#cocktail .target img").attr("src", $(this).attr("href"));
					return false;
				}
			);
 	$("#mandala .thumbnail a")
		.hover( 
			function(){
				$(this).fadeTo(200, 0.8);
			},function(){
				$(this).fadeTo(600, 1.0);
			}
		)
			.click(
				function() {
					$("#mandala .target img").attr("src", $(this).attr("href"));
					return false;
				}
			);
 	$("#pyramid .thumbnail a")
		.hover( 
			function(){
				$(this).fadeTo(200, 0.8);
			},function(){
				$(this).fadeTo(600, 1.0);
			}
		)
			.click(
				function() {
					$("#pyramid .target img").attr("src", $(this).attr("href"));
					return false;
				}
			);
 	$("#tomb .thumbnail a")
		.hover( 
			function(){
				$(this).fadeTo(200, 0.8);
			},function(){
				$(this).fadeTo(600, 1.0);
			}
		)
			.click(
				function() {
					$("#tomb .target img").attr("src", $(this).attr("href"));
					return false;
				}
			);
 	$("#bunny .thumbnail a")
		.hover( 
			function(){
				$(this).fadeTo(200, 0.8);
			},function(){
				$(this).fadeTo(600, 1.0);
			}
		)
			.click(
				function() {
					$("#bunny .target img").attr("src", $(this).attr("href"));
					return false;
				}
			);
}):