【发布时间】:2013-08-21 23:14:45
【问题描述】:
我有一个网站,它使用 ajax 在用户单击按钮时引入内容。除非有人使用移动版 Safari 的“添加到主屏幕”功能,然后使用主屏幕上的图标打开网站,否则此方法可以正常工作。
当有人从主屏幕图标打开网站时,一切正常,直到 ajax 加载部分。当有人单击该链接时,屏幕会闪烁白色,然后加载内容,但是应该在加载函数中运行的所有函数都没有实际运行。就像内容被加载了,但应该发生的动画没有发生,页面看起来很糟糕。
这是一个奇怪的问题,我无法检查问题,因为我无法访问我的控制台。
这是我的网络应用程序的链接(尚未完成)-http://chrisgjones.com/aut/1.3/
我的 ajax 负载看起来像这样
<div class="inner">
<a href="farm.html">Link</a>
</div>
function loadProject(){
var $load = $('#level');
$(document).on('click','.inner a',function(e){
e.preventDefault();
$this = $(this);
var _sourceTarget = '#puzzle',
_url= $this.attr('href');
$load.load(_url+" "+_sourceTarget, function(){
animalSlider();
setTimeout(function(){
$('.animal-content').centerRelative();
}, 2000);
$('#level-selection').animate({'left':'-200%'}, _speed, _ease, function(){
$logo.animate({'top':'10%'}, _speed, _ease);
$loader.animate({'margin-bottom':'10px'}, _speed, _ease, function(){
setTimeout(function(){
$logo.animate({'top':-_logoHeight}, _speed, _ease);
$loader.animate({'margin-bottom':-_loaderHeight}, _speed, _ease, function(){
$splash.delay(_speed).fadeOut(_speed*2);
});
}, 3000);
});
});
}); // end load
}); // end click
} // end function
【问题讨论】:
标签: javascript jquery iphone web-applications mobile-safari