我使用以下代码加载AJAX内容
jQuery(document).ready(function($) {
$('.outer-nav a').on('click', function() {
var href = $(this).attr('href');
if ($('#ajax').is(':visible')) {
$('#ajax').css({ display:'block' }).animate({ height:'100%' }).empty();
}
$('#ajax').css({ display:'block' }).animate({ height:'100%' },function() {
$('#ajax').load('slide-fade-content.html ' + href, function() {
if (window.location.hash == "href") {
}
$('#ajax').hide().fadeIn('slow');
$('#showMenu, .open').fadeIn('slow');
$('.container').css('pointer-events', 'auto');
});
});
});
});slide-fade-content.html如下所示
<div id="load">
<div id="first-item>
content
</div>
<div id="second-item>
content
</div>
</div>
and my index.html has links like this <a href="#first-item">Link 1</a>然后用这个来激活wow.js
<script type="text/javascript">
jQuery(document).ready(function() {
$("#showMenu").click(function() {
$('#logo, #details-wrapper, #side-text').fadeIn();
return false;
});
});
</script>但是wow.js似乎不工作,我没有收到任何错误。我在一个没有ajax的普通网站上测试了代码,它工作得很好。
发布于 2014-03-06 02:26:31
为什么在试图加载的文件和href变量之间有一个空格?这可能解释了为什么ajax调用不起作用。
$('#ajax').load('slide-fade-content.html ' + href, function() {发布于 2014-05-13 18:50:10
参见WOW.js Issue #71。
简短的答案是,目前WOW.js不支持异步加载的内容。一旦我们解决了这个问题,它就会实现。
https://stackoverflow.com/questions/22205854
复制相似问题