Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/439.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不能正常工作吗?_Javascript_Jquery_Html_Twitter Bootstrap - Fatal编程技术网

为什么';当我包含引导时,我的javascript不能正常工作吗?

为什么';当我包含引导时,我的javascript不能正常工作吗?,javascript,jquery,html,twitter-bootstrap,Javascript,Jquery,Html,Twitter Bootstrap,下午好 我整个下午都在试图找出代码的问题。有趣的是,当我把我的代码放在codepen上时,它工作得很好。在我的电脑上,它没有。 发生的事情是,我制作了一个jquery代码,以便在向下滚动页面时向元素添加“淡入”效果。然后,在我工作的中间,我决定要使用引导程序,然后我把它包含在头部分中: <link rel="stylesheet" type="text/css" href="bootstrap-3.3-1.7-dist/css/bootstrap.min.css">. 有人有线索吗

下午好

我整个下午都在试图找出代码的问题。有趣的是,当我把我的代码放在codepen上时,它工作得很好。在我的电脑上,它没有。 发生的事情是,我制作了一个jquery代码,以便在向下滚动页面时向元素添加“淡入”效果。然后,在我工作的中间,我决定要使用引导程序,然后我把它包含在头部分中:
<link rel="stylesheet" type="text/css" href="bootstrap-3.3-1.7-dist/css/bootstrap.min.css">.

有人有线索吗?

尝试在html页面末尾的jquery之后加载引导,而不是在结束正文标记之前加载标题。可能是加载顺序的问题?

我想您可能与bootstrap使用的保留字冲突。例如,尝试在类的末尾添加一个“2”,看看它是否有效。
$(document).ready(function(){

         $('.hideme').each(function(i){
            var bottom_of_object = $(this).position().top + $(this).outerHeight();
            var bottom_of_window = $(window).scrollTop() + $(window).height();
            console.log($(this).position().top);


            // If the object is completely visible in the window, fade it it 
            if(bottom_of_window > $(this).position().top){

                $(this).animate({'opacity':'1'},1000);
             }


        }); 

    });



    //Click event to scroll to top
    $('.scrollToTop').click(function(){
        $('html, body').animate({scrollTop : 0},'slow');
        return false;
    });

    $("#who").click(function() {
        $('html,body').animate({
        scrollTop: $(".about").offset().top}, 'slow');
        return true;
        });

    $("#projects").click(function() {
        $('html,body').animate({
        scrollTop: $("#projectsResponse").offset().top}, 'slow');
        return true;
        });

    $("#vision").click(function() {
        $('html,body').animate({
        scrollTop: $("#qualities").offset().top}, 'slow');
        return true;
        });

    $("#contact").click(function() {
        $('html,body').animate({
        scrollTop: $("#divisor_contato").offset().top}, 'slow');
        return true;
        });

    $("#contact2").click(function() {
        $('html,body').animate({
        scrollTop: $("#divisor_contato").offset().top}, 'slow');
        return true;
        });


});