User:KazutoIKEDA/wiki/change-image.js

From 2009.igem.org

< User:KazutoIKEDA(Difference between revisions)
 
(47 intermediate revisions not shown)
Line 1: Line 1:
$(document).ready( function() {
$(document).ready( function() {
-
$("#biomario .thumbnail a")
+
    $(".thumbnail img")
-
.hover(  
+
    .hover(  
-
function(){
+
        function(){// マウスオーバー時
-
$(this).fadeTo(200, 0.8);
+
            $(this).fadeTo(200, 0.7);
-
},function(){
+
        },
-
$(this).fadeTo(600, 1.0);
+
        function(){// マウスアウト時
-
}
+
            $(this).fadeTo(500, 1.0);
-
)
+
        })
-
.click(
+
});
-
function() {
+
 
-
$("#biomario .target img").attr("src", $(this).attr("href"));
+
function showimg1(val){
-
return false;
+
if(val==1){
-
}
+
document.obj1.src = "https://static.igem.org/mediawiki/2009/2/2c/Mandala1.jpg";
-
);
+
}else if(val==2){
-
$("#cocktail .thumbnail a")
+
document.obj1.src = "https://static.igem.org/mediawiki/2009/a/af/Mandala2.jpg";
-
.hover(
+
}else if(val==3){
-
function(){
+
document.obj1.src = "https://static.igem.org/mediawiki/2009/7/74/Mandala3.jpg";
-
$(this).fadeTo(200, 0.8);
+
}else if(val==4){
-
},function(){
+
document.obj1.src = "https://static.igem.org/mediawiki/2009/e/e8/Mandala4.jpg";
-
$(this).fadeTo(600, 1.0);
+
}else if(val==5){
-
}
+
document.obj1.src = "https://static.igem.org/mediawiki/2009/6/61/Mandala5.jpg";
-
)
+
}else if(val==6){
-
.click(
+
document.obj1.src = "https://static.igem.org/mediawiki/2009/e/e0/Mandala6.jpg";
-
function() {
+
}
-
$("#cocktail .target img").attr("src", $(this).attr("href"));
+
}
-
return false;
+
 
-
}
+
function showimg2(val){
-
);
+
if(val==1){
-
$("#mandala .thumbnail a")
+
document.obj2.src = "https://static.igem.org/mediawiki/2009/4/40/Mario1.gif";
-
.hover(
+
}else if(val==2){
-
function(){
+
document.obj2.src = "https://static.igem.org/mediawiki/2009/b/be/Mario2.jpg";
-
$(this).fadeTo(200, 0.8);
+
}else if(val==3){
-
},function(){
+
document.obj2.src = "https://static.igem.org/mediawiki/2009/0/0e/Mario3.jpg";
-
$(this).fadeTo(600, 1.0);
+
}else if(val==4){
-
}
+
document.obj2.src = "https://static.igem.org/mediawiki/2009/d/d0/Invader1.jpg";
-
)
+
}else if(val==5){
-
.click(
+
document.obj2.src = "https://static.igem.org/mediawiki/2009/6/60/Invader2.jpg";
-
function() {
+
}else if(val==6){
-
$("#mandala .target img").attr("src", $(this).attr("href"));
+
document.obj2.src = "https://static.igem.org/mediawiki/2009/1/1b/Invader3.jpg";
-
return false;
+
}
-
}
+
}
-
);
+
 
-
$("#pyramid .thumbnail a")
+
function showimg3(val){
-
.hover(
+
if(val==1){
-
function(){
+
document.obj3.src = "https://static.igem.org/mediawiki/2009/b/bb/Pyramid1.jpg";
-
$(this).fadeTo(200, 0.8);
+
}else if(val==2){
-
},function(){
+
document.obj3.src = "https://static.igem.org/mediawiki/2009/3/30/Pyramid2.jpg";
-
$(this).fadeTo(600, 1.0);
+
}else if(val==3){
-
}
+
document.obj3.src = "https://static.igem.org/mediawiki/2009/1/1c/Pyramid3.jpg";
-
)
+
}else if(val==4){
-
.click(
+
document.obj3.src = "https://static.igem.org/mediawiki/2009/7/7a/Pyramid4.jpg";
-
function() {
+
}else if(val==5){
-
$("#pyramid .target img").attr("src", $(this).attr("href"));
+
document.obj3.src = "https://static.igem.org/mediawiki/2009/9/97/Pyramid5.jpg";
-
return false;
+
}else if(val==6){
-
}
+
document.obj3.src = "https://static.igem.org/mediawiki/2009/b/bf/Pyramid6.jpg";
-
);
+
}
-
$("#tomb .thumbnail a")
+
}
-
.hover(
+
 
-
function(){
+
function showimg4(val){
-
$(this).fadeTo(200, 0.8);
+
if(val==1){
-
},function(){
+
document.obj4.src = "https://static.igem.org/mediawiki/2009/e/e0/Cocktail1.jpg";
-
$(this).fadeTo(600, 1.0);
+
}else if(val==2){
-
}
+
document.obj4.src = "https://static.igem.org/mediawiki/2009/f/ff/Cocktail2.jpg";
-
)
+
}else if(val==3){
-
.click(
+
document.obj4.src = "https://static.igem.org/mediawiki/2009/7/71/Cocktail3.jpg";
-
function() {
+
}else if(val==4){
-
$("#tomb .target img").attr("src", $(this).attr("href"));
+
document.obj4.src = "https://static.igem.org/mediawiki/2009/d/d8/Cocktail4.jpg";
-
return false;
+
}else if(val==5){
-
}
+
document.obj4.src = "https://static.igem.org/mediawiki/2009/d/d7/Cocktail5.jpg";
-
);
+
}else if(val==6){
-
$("#bunny .thumbnail a")
+
document.obj4.src = "https://static.igem.org/mediawiki/2009/6/6d/Cocktail6.jpg";
-
.hover(
+
}
-
function(){
+
}
-
$(this).fadeTo(200, 0.8);
+
 
-
},function(){
+
function showimg5(val){
-
$(this).fadeTo(600, 1.0);
+
if(val==1){
-
}
+
document.obj5.src = "https://static.igem.org/mediawiki/2009/b/b4/GFP_paper_bunny1.jpg";
-
)
+
}else if(val==2){
-
.click(
+
document.obj5.src = "https://static.igem.org/mediawiki/2009/3/3b/GFP_paper_bunny2.jpg";
-
function() {
+
}else if(val==3){
-
$("#bunny .target img").attr("src", $(this).attr("href"));
+
document.obj5.src = "https://static.igem.org/mediawiki/2009/7/7c/GFP_paper_bunny3.jpg";
-
return false;
+
}else if(val==4){
-
}
+
document.obj5.src = "https://static.igem.org/mediawiki/2009/6/67/GFP_paper_bunny4.jpg";
-
);
+
}else if(val==5){
-
}):
+
document.obj5.src = "https://static.igem.org/mediawiki/2009/a/a3/GFP_paper_bunny5.jpg";
 +
}else if(val==6){
 +
document.obj5.src = "https://static.igem.org/mediawiki/2009/0/03/GFP_paper_bunny6.jpg";
 +
}
 +
}
 +
 
 +
function showimg6(val){
 +
if(val==1){
 +
document.obj6.src = "https://static.igem.org/mediawiki/2009/d/da/Tomb1.jpg";
 +
}else if(val==2){
 +
document.obj6.src = "https://static.igem.org/mediawiki/2009/8/85/Tomb2.jpg";
 +
}else if(val==3){
 +
document.obj6.src = "https://static.igem.org/mediawiki/2009/0/08/Tomb3.jpg";
 +
}else if(val==4){
 +
document.obj6.src = "https://static.igem.org/mediawiki/2009/7/74/Tomb4.jpg";
 +
}else if(val==5){
 +
document.obj6.src = "https://static.igem.org/mediawiki/2009/e/e5/Tomb5.jpg";
 +
}else if(val==6){
 +
document.obj6.src = "https://static.igem.org/mediawiki/2009/6/69/Tomb6.jpg";
 +
}
 +
}

Latest revision as of 02:50, 22 October 2009

$(document).ready( function() {
    $(".thumbnail img")
    .hover( 
        function(){// マウスオーバー時
            $(this).fadeTo(200, 0.7);
        },
        function(){// マウスアウト時
            $(this).fadeTo(500, 1.0);
        })
});

function showimg1(val){
if(val==1){
document.obj1.src = "https://static.igem.org/mediawiki/2009/2/2c/Mandala1.jpg";
}else if(val==2){
document.obj1.src = "https://static.igem.org/mediawiki/2009/a/af/Mandala2.jpg";
}else if(val==3){
document.obj1.src = "https://static.igem.org/mediawiki/2009/7/74/Mandala3.jpg";
}else if(val==4){
document.obj1.src = "https://static.igem.org/mediawiki/2009/e/e8/Mandala4.jpg";
}else if(val==5){
document.obj1.src = "https://static.igem.org/mediawiki/2009/6/61/Mandala5.jpg";
}else if(val==6){
document.obj1.src = "https://static.igem.org/mediawiki/2009/e/e0/Mandala6.jpg";
}
}

function showimg2(val){
if(val==1){
document.obj2.src = "https://static.igem.org/mediawiki/2009/4/40/Mario1.gif";
}else if(val==2){
document.obj2.src = "https://static.igem.org/mediawiki/2009/b/be/Mario2.jpg";
}else if(val==3){
document.obj2.src = "https://static.igem.org/mediawiki/2009/0/0e/Mario3.jpg";
}else if(val==4){
document.obj2.src = "https://static.igem.org/mediawiki/2009/d/d0/Invader1.jpg";
}else if(val==5){
document.obj2.src = "https://static.igem.org/mediawiki/2009/6/60/Invader2.jpg";
}else if(val==6){
document.obj2.src = "https://static.igem.org/mediawiki/2009/1/1b/Invader3.jpg";
}
}

function showimg3(val){
if(val==1){
document.obj3.src = "https://static.igem.org/mediawiki/2009/b/bb/Pyramid1.jpg";
}else if(val==2){
document.obj3.src = "https://static.igem.org/mediawiki/2009/3/30/Pyramid2.jpg";
}else if(val==3){
document.obj3.src = "https://static.igem.org/mediawiki/2009/1/1c/Pyramid3.jpg";
}else if(val==4){
document.obj3.src = "https://static.igem.org/mediawiki/2009/7/7a/Pyramid4.jpg";
}else if(val==5){
document.obj3.src = "https://static.igem.org/mediawiki/2009/9/97/Pyramid5.jpg";
}else if(val==6){
document.obj3.src = "https://static.igem.org/mediawiki/2009/b/bf/Pyramid6.jpg";
}
}

function showimg4(val){
if(val==1){
document.obj4.src = "https://static.igem.org/mediawiki/2009/e/e0/Cocktail1.jpg";
}else if(val==2){
document.obj4.src = "https://static.igem.org/mediawiki/2009/f/ff/Cocktail2.jpg";
}else if(val==3){
document.obj4.src = "https://static.igem.org/mediawiki/2009/7/71/Cocktail3.jpg";
}else if(val==4){
document.obj4.src = "https://static.igem.org/mediawiki/2009/d/d8/Cocktail4.jpg";
}else if(val==5){
document.obj4.src = "https://static.igem.org/mediawiki/2009/d/d7/Cocktail5.jpg";
}else if(val==6){
document.obj4.src = "https://static.igem.org/mediawiki/2009/6/6d/Cocktail6.jpg";
}
}

function showimg5(val){
if(val==1){
document.obj5.src = "https://static.igem.org/mediawiki/2009/b/b4/GFP_paper_bunny1.jpg";
}else if(val==2){
document.obj5.src = "https://static.igem.org/mediawiki/2009/3/3b/GFP_paper_bunny2.jpg";
}else if(val==3){
document.obj5.src = "https://static.igem.org/mediawiki/2009/7/7c/GFP_paper_bunny3.jpg";
}else if(val==4){
document.obj5.src = "https://static.igem.org/mediawiki/2009/6/67/GFP_paper_bunny4.jpg";
}else if(val==5){
document.obj5.src = "https://static.igem.org/mediawiki/2009/a/a3/GFP_paper_bunny5.jpg";
}else if(val==6){
document.obj5.src = "https://static.igem.org/mediawiki/2009/0/03/GFP_paper_bunny6.jpg";
}
}

function showimg6(val){
if(val==1){
document.obj6.src = "https://static.igem.org/mediawiki/2009/d/da/Tomb1.jpg";
}else if(val==2){
document.obj6.src = "https://static.igem.org/mediawiki/2009/8/85/Tomb2.jpg";
}else if(val==3){
document.obj6.src = "https://static.igem.org/mediawiki/2009/0/08/Tomb3.jpg";
}else if(val==4){
document.obj6.src = "https://static.igem.org/mediawiki/2009/7/74/Tomb4.jpg";
}else if(val==5){
document.obj6.src = "https://static.igem.org/mediawiki/2009/e/e5/Tomb5.jpg";
}else if(val==6){
document.obj6.src = "https://static.igem.org/mediawiki/2009/6/69/Tomb6.jpg";
}
}