weixin_33698823 2014-03-05 18:14 采纳率: 0%
浏览 47

wow.js和ajax内容

I using the following code to load in 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 looks something like this

<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>

and then this to activate wow.js

<script type="text/javascript">
jQuery(document).ready(function() {
    $("#showMenu").click(function() {
        $('#logo, #details-wrapper, #side-text').fadeIn();
        return false;
    });
});
</script>

But wow.js doesn't seem to be working and i'm not getting any errors. I tested the code on a plain website with no ajax and it worked perfectly.

  • 写回答

2条回答 默认 最新

  • weixin_33736048 2014-03-05 18:26
    关注

    why do you have a space between the file you're trying to load and the href variable? that might explain why the ajax call isn't working.

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

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿