wow.js and ajax content



i使用以下代码加载ajax content

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>

但是哇,js似乎没有起作用,我没有遇到任何错误。我在没有AJAX的普通网站上测试了代码,并且效果很好。

为什么在要加载的文件和HREF变量之间有一个空间?这可能解释了为什么Ajax调用不起作用。

$('#ajax').load('slide-fade-content.html ' + href, function() {

请参阅WOW.JS问题#71。

简短的答案是,现在,wow.js不支持异步加载的内容。一旦我们解决了这个问题。

最新更新