HTML

function judge(temp)
{
if (isused[temp]) return;
isused[temp]=true;
lastImg1=currImg1;
currImg1=temp;



var currImg=document.getElementById("img_"+temp);
currImg.src="photo/image"+myArray[temp]+".jpg";
//alert(myArray[temp]);
if(currImg1>=0 &&lastImg1>=0)
{

if(myArray[currImg1]==myArray[lastImg1])
{
count++;
score++;
jifen1=score*20;
document.getElementById("mt3").innerHTML=jifen1;
currImg1=lastImg1=-1;
if(count>=n)
{
clearInterval(myinter);
mytime=mytime+((n*2)+40);
alert("Next");
createTable();
count=0;


}
}
else
{

var lastImg=document.getElementById("img_"+lastImg1);
lastImg.src="photo/image0.jpg";
isused[lastImg1]=false;
}

}
}

posted @ 2016-04-21 20:25  晓样  阅读(105)  评论(0编辑  收藏  举报