User:KazutoIKEDA/wiki/change-image.js

From 2009.igem.org

(Difference between revisions)
Line 31: Line 31:
}
}
-
function showimg2(){
+
function showimg2(val){
-
document.obj.src = "画像2のURL";
+
if(val==1){
 +
document.obj2.src = "https://static.igem.org/mediawiki/2009/2/2c/Mandala1.jpg";
 +
}else if(val==2){
 +
document.obj2.src = "https://static.igem.org/mediawiki/2009/a/af/Mandala2.jpg";
 +
}else if(val==3){
 +
document.obj2.src = "https://static.igem.org/mediawiki/2009/7/74/Mandala3.jpg";
 +
}else if(val==4){
 +
document.obj2.src = "https://static.igem.org/mediawiki/2009/e/e8/Mandala4.jpg";
 +
}else if(val==5){
 +
document.obj2.src = "https://static.igem.org/mediawiki/2009/6/61/Mandala5.jpg";
 +
}else if(val==6){
 +
document.obj2.src = "https://static.igem.org/mediawiki/2009/e/e0/Mandala6.jpg";
 +
}
}
}
-
function showimg3(){
+
function showimg3(val){
-
document.obj.src = "画像3のURL";
+
if(val==1){
 +
document.obj3.src = "https://static.igem.org/mediawiki/2009/2/2c/Mandala1.jpg";
 +
}else if(val==2){
 +
document.obj3.src = "https://static.igem.org/mediawiki/2009/a/af/Mandala2.jpg";
 +
}else if(val==3){
 +
document.obj3.src = "https://static.igem.org/mediawiki/2009/7/74/Mandala3.jpg";
 +
}else if(val==4){
 +
document.obj3.src = "https://static.igem.org/mediawiki/2009/e/e8/Mandala4.jpg";
 +
}else if(val==5){
 +
document.obj3.src = "https://static.igem.org/mediawiki/2009/6/61/Mandala5.jpg";
 +
}else if(val==6){
 +
document.obj3.src = "https://static.igem.org/mediawiki/2009/e/e0/Mandala6.jpg";
 +
}
 +
}
 +
 
 +
function showimg4(val){
 +
if(val==1){
 +
document.obj4.src = "https://static.igem.org/mediawiki/2009/2/2c/Mandala1.jpg";
 +
}else if(val==2){
 +
document.obj4.src = "https://static.igem.org/mediawiki/2009/a/af/Mandala2.jpg";
 +
}else if(val==3){
 +
document.obj4.src = "https://static.igem.org/mediawiki/2009/7/74/Mandala3.jpg";
 +
}else if(val==4){
 +
document.obj4.src = "https://static.igem.org/mediawiki/2009/e/e8/Mandala4.jpg";
 +
}else if(val==5){
 +
document.obj4.src = "https://static.igem.org/mediawiki/2009/6/61/Mandala5.jpg";
 +
}else if(val==6){
 +
document.obj4.src = "https://static.igem.org/mediawiki/2009/e/e0/Mandala6.jpg";
 +
}
 +
}
 +
 
 +
function showimg5(val){
 +
if(val==1){
 +
document.obj5.src = "https://static.igem.org/mediawiki/2009/2/2c/Mandala1.jpg";
 +
}else if(val==2){
 +
document.obj5.src = "https://static.igem.org/mediawiki/2009/a/af/Mandala2.jpg";
 +
}else if(val==3){
 +
document.obj5.src = "https://static.igem.org/mediawiki/2009/7/74/Mandala3.jpg";
 +
}else if(val==4){
 +
document.obj5.src = "https://static.igem.org/mediawiki/2009/e/e8/Mandala4.jpg";
 +
}else if(val==5){
 +
document.obj5.src = "https://static.igem.org/mediawiki/2009/6/61/Mandala5.jpg";
 +
}else if(val==6){
 +
document.obj5.src = "https://static.igem.org/mediawiki/2009/e/e0/Mandala6.jpg";
 +
}
}
}

Revision as of 20:25, 21 October 2009

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

});

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/2/2c/Mandala1.jpg";
}else if(val==2){
document.obj2.src = "https://static.igem.org/mediawiki/2009/a/af/Mandala2.jpg";
}else if(val==3){
document.obj2.src = "https://static.igem.org/mediawiki/2009/7/74/Mandala3.jpg";
}else if(val==4){
document.obj2.src = "https://static.igem.org/mediawiki/2009/e/e8/Mandala4.jpg";
}else if(val==5){
document.obj2.src = "https://static.igem.org/mediawiki/2009/6/61/Mandala5.jpg";
}else if(val==6){
document.obj2.src = "https://static.igem.org/mediawiki/2009/e/e0/Mandala6.jpg";
}
}

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

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

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