下面的代码适用于所有其他浏览器栏 IE。代码基本上看起来让用户选择一张卡片,如果有,它选择另一张没有被挑选的卡片,然后将它添加到一个数组中。不幸的是,它在 IE 中不起作用。没有控制台错误。
有没有人有任何想法?
谢谢
function getCard(clicked_id)
{
$("#frontCard").animate({
height:"-=600",
width:"-=250",
},1000,'easeOutElastic');
$("#frontCard").css("opacity",0);
clicked_id = "#" + clicked_id;
$(clicked_id).animate({ opacity: 0, left: "700px" }, 'slow');
$("#frontCard").animate({
height:"+=400",
width:"+=250",
},1000,'easeOutElastic');
$("#frontCard").css("opacity",1);
var newCard= Math.floor((Math.random()*13)+1);
var newSuit= Math.floor((Math.random()*4)+1);
var currentCard;
var x=document.getElementById("pick");
var rules=document.getElementById("rules");
var kings=document.getElementById("kings");
var currentCards=document.getElementById("currentCard");
if (cardsPicked.indexOf(numbers[newCard-1] + " " + suits[newSuit-1])== -1){
if (numbers[newCard-1]=="K" && king<4){
king=king+1;
}
if(king==4){
king= "All kings found!";
alert("Fourth king picked. Down the jug!");
}
cardsPicked.push(numbers[newCard-1] + " " + suits[newSuit-1] );
for (count=0; count<cardsPicked.length; count++)
currentRule = cardRules[newCard-1];
x.innerHTML=cardsPicked;
currentCards.innerHTML=numbers[newCard-1] + " " + suits[newSuit-1];
rules.innerHTML=currentRule;
kings.innerHTML=king;
}else{
getCard();
}
}