我從Codeacademy jQuery ex複製/粘貼代碼。 4,「什麼是jQuery?」,放到我的筆記本電腦上相同的html,css和javascript文件中。然後我把這個推給了我的github.io; jQuery代碼似乎不能在我的Firefox瀏覽器(針對Ubuntu規範 - 版本26)中工作 - 1.0)。該代碼絕對在Codeacademy屏幕上工作。jQuery適用於Codeacademy,但不適用於通過github.io部署的Firefox。
這裏的index.html:
<!DOCTYPE html>
<html>
<head>
<title>What Say You?</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<div id="ready">I'm ready!</div>
<div id="notready">You'll never take me alive, jQuery!</div>
</body>
</html>
這裏的stylesheet.css中
div {
height:100px;
width:100px;
border-radius:5px;
display: inline-block;
text-align: center;
vertical-align: middle;
font-family: Verdana, Arial, Sans-Serif;
margin-right:5px;
}
#ready {
background-color:#008800;
color:#FFFFFF;
}
#notready {
background-color:#FF0000;
color:#FFFFFF;
}
這裏的script.js:
$(document).ready(function() {
$('#notready').fadeOut(1000);
});
的頁面是在這裏:http://bonza-times.github.io/
如何讓這段代碼在Firefox中正確工作?謝謝!