我正在用我在这里找到的模板构建一个iOS7 WebApp:http://c2prods.com/2013/cloning-the-ui-of-ios-7-with-html-css-and-javascript/
我已经编写了一些JavaScript/jQuery,它会先淡出图片,然后淡出工具栏中的工具栏。我有一个空白的测试页面来测试脚本。它工作得很完美。然后,我复制并粘贴完全相同的代码到真实的页面中,而jQuery似乎从来没有因为任何原因而加载。它给了我一个错误,说了以下几句:
未明的TypeError:对象#没有方法'fadeOut‘
褪色应该在3秒后发生。想法是这是一个飞溅的屏幕。
以下是我的JS/jQuery:
$(document).ready(function() {
fadeAwaySplash();
navFadeIn();
//Insert More Functions Here
});
function fadeAwaySplash() {
//setTimeout(function() {
$("#splash-screen").fadeOut();
//}, 3000);
}
function navFadeIn(){
setTimeout(function() {
$("nav").fadeIn();
}, 3000);
}这是我的CSS:
nav {
position: fixed;
bottom: 0;
width: 100%;
height: 49px;
text-align: center;
background-color: rgba(248, 248, 248, 0.9);
background-image: linear-gradient(180deg, rgb(200, 199, 204), rgb(200, 199, 204) 50%, transparent 50%);
background-size: 100% 1px;
background-repeat: no-repeat;
background-position: top center;
z-index: 100;
display: none;
}
#splash-screen {
position: absolute;
z-index: 999999;
width: 100%;
height: 100%;
min-width: 100%;
min-height: 100%;
max-width: 100%;
max-height: 100%;
}以下是我的HTML:
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<img src="/img/ipadSplash.png" id="splash-screen">任何帮助都是非常感谢的。
谢谢你,伊曼纽尔
发布于 2014-05-14 14:04:59
太棒了!史克格的回答成功了!我所要做的就是用"jQuery“(没有引号)替换$s。尽管我不得不用.delay(3000)代替setTimeout,谢谢!
https://stackoverflow.com/questions/23633646
复制相似问题