Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Jquery文件未加载_Javascript_Jquery_Loading - Fatal编程技术网

Javascript Jquery文件未加载

Javascript Jquery文件未加载,javascript,jquery,loading,Javascript,Jquery,Loading,我有点困惑。。。当javascript文件位于标记中另一个jquery文件的上方时,我可以加载javascript文件,但是当javascript文件位于其他jquery文件的下方时,它不会加载 当我把它放在jquery.min.js文件上方时,它的加载很好,但当它放在下方时,它无法加载 我想我的jquery文件有问题。。但不确定是什么 我的Javascript文件是: /* =======================================================

我有点困惑。。。当javascript文件位于标记中另一个jquery文件的上方时,我可以加载javascript文件,但是当javascript文件位于其他jquery文件的下方时,它不会加载

当我把它放在jquery.min.js文件上方时,它的加载很好,但当它放在下方时,它无法加载

我想我的jquery文件有问题。。但不确定是什么

我的Javascript文件是:

/*      =======================================================================================================================================*/
// gallery slider
/* =======================================================================================================================================*/

  $(document).ready(function () {

            $('.project').mouseover(function ()
            {
                $(this).children('.cover').animate(
                {
                    height: "172px"
                });
                $(this).children('.title').animate(
                {
                    bottom: '-25px', height: "100px"
                });
            });

            $('.project').mouseleave(function ()
            {
                $(this).children('.cover').animate(
                {
                    height: "17px"
                });
                $(this).children('.title').animate(
                {
                    bottom: "0px", height: "20px"
                });
            });

             });

/* =======================================================================================================================================*/
// Top Contact Area
/* =======================================================================================================================================*/


$(window).load(function () {
$("#contactArea").css('height', '0px');

$(".contact-hurry a").toggle( 
            function () { 
                $(this).text('Quick Contact Hide / Close [-]')
                $("#contactArea").animate({height: "225px"}, {queue:false, duration: 500, easing: 'linear'})
                $("body").addClass("reposition-bg",{queue:false, duration: 500, easing: 'linear'})
            }, 
            function () { 
                $(this).text('Quick Contact Show / Open [+]')
                $("body").removeClass("reposition-bg",{queue:false, duration: 500, easing: 'linear'})
                $("#contactArea").animate({height: "0px"}, {queue:false, duration: 500, easing: 'linear'}) 
            } 
    ); 


});


/* =======================================================================================================================================*/
// Mega Menu    $("#contactArea").css('height', '0px');
/* =======================================================================================================================================*/


$(document).ready(function () {


function megaHoverOver(){
    $(this).find(".sub").stop().fadeTo('fast', 1).show();

    //Calculate width of all ul's
    (function($) { 
        jQuery.fn.calcSubWidth = function() {
            rowWidth = 150;
            //Calculate row
            $(this).find("ul.floating").each(function() {                   
                rowWidth += $(this).width(); 
            }); 
        };
    })(jQuery); 

    if ( $(this).find(".row").length > 0 ) { //If row exists...
        var biggestRow = 0; 
        //Calculate each row
        $(this).find(".row").each(function() {                             
            $(this).calcSubWidth();
            //Find biggest row
            if(rowWidth > biggestRow) {
                biggestRow = rowWidth;
            }
        });
        //Set width
        $(this).find(".sub").css({'width' :biggestRow});
        $(this).find(".row:last").css({'margin':'0'});

    } else { //If row does not exist...

        $(this).calcSubWidth();
        //Set Width
        $(this).find(".sub").css({'width' : rowWidth});

    }
}   
function megaHoverOut(){ 
  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
      $(this).hide(); 
  });
}


var config = {    
     sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
     interval: 100, // number = milliseconds for onMouseOver polling interval    
     over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
     timeout: 100, // number = milliseconds delay before onMouseOut    
     out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
};

$("ul#topnav li .sub").css({'opacity':'0'});
$("ul#topnav li").hoverIntent(config);




jQuery(function() {
        // run the currently selected effect
        function runEffect() {
            // get effect type from 
            var selectedEffect = $( "#effectTypes" ).val();

            // most effect types need no options passed by default
            var options = {};
            // some effects have required parameters
            if ( selectedEffect === "scale" ) {
                options = { percent: 0 };
            } else if ( selectedEffect === "size" ) {
                options = { to: { width: 200, height: 60 } };
            }

            // run the effect
            $( "#effect" ).toggle( selectedEffect, options, 500 );
        };

        // set effect from select menu value
        $( "#button" ).click(function() {
            runEffect();
            return false;
        });
    });




  /* =======================================================================================================================================*/
// faqs
/* =======================================================================================================================================*/


$(document).ready(function(){
                $("#faqs tr:odd").addClass("odd");
                $("#faqs tr:not(.odd)").hide();
                $("#faqs tr:first-child").show();

                $("#faqs tr.odd").click(function(){
                    $(this).next("tr").toggle('fast');
                    $(this).find(".arrow").toggleClass("up");
                });

            }); 


   /* =======================================================================================================================================*/
// Portfolio slider
/* =======================================================================================================================================*/

/*
$(document).ready(function() {

var currentImage;
var currentIndex = -1;
var interval;
function showImage(index){
    if(index < $('#bigPic img').length){
        var indexImage = $('#bigPic img')[index]
        if(currentImage){   
            if(currentImage != indexImage ){
                $(currentImage).css('z-index',2);
                clearTimeout(myTimer);
                $(currentImage).fadeOut(250, function() {
                    myTimer = setTimeout("showNext()", 3900);
                    $(this).css({'display':'none','z-index':1})
                });
            }
        }
        $(indexImage).css({'display':'block', 'opacity':1});
        currentImage = indexImage;
        currentIndex = index;
        $('#thumbs li').removeClass('active');
        $($('#thumbs li')[index]).addClass('active');
    }
}

function showNext(){
    var len = $('#bigPic img').length;
    var next = currentIndex < (len-1) ? currentIndex + 1 : 0;
    showImage(next);
}

var myTimer;

$(document).ready(function() {
    myTimer = setTimeout("showNext()", 3000);
    showNext(); //loads first image

});

});

*/




$("#foo2").carouFredSel({
    circular: false,
    infinite: false,
    auto    : false,
    scroll  : {
        items   : "page"
    },
    prev    : { 
        button  : "#foo2_prev",
        key     : "left"
    },
    next    : { 
        button  : "#foo2_next",
        key     : "right"
    },
    pagination  : "#foo2_pag"
});



});

我不知道你到底是什么意思,但我试一试

如果在使用jquery的脚本文件之前包含jquery库,那么这些将成功。 使用jquery的脚本必须定义符号$和jquery,javascript从上到下顺序运行文件


这就是为什么必须先包含jquery。

什么意思,它不加载?你怎么知道?是否报告错误?存在多个document.load和window.ready。考虑合并这些代码使你的代码更容易阅读。感谢Tip Kyle。我在Chrome PosiTy中得到以下消息:unType Type Error:对象'Obj'的对象[对象窗口]不是一个没有看到HTML的函数,它导入的脚本很难说。这可能意味着您要在导入jQuery之前导入脚本。