Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.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
如何在jquery中更新函数_Jquery - Fatal编程技术网

如何在jquery中更新函数

如何在jquery中更新函数,jquery,Jquery,我在JQUERY中有函数,它在库中工作。Buf如果我使用库,我的脚本不工作:(。 有人知道吗 我的职能: $( window ).resize(function() { setFooter(); }); function setFooter() { var docHeight = $( document ).height(); var footerHeight = $('footer').height(); var footerTop = $('footer').po

我在JQUERY中有函数,它在库中工作。Buf如果我使用库,我的脚本不工作:(。 有人知道吗

我的职能:

$( window ).resize(function() {
    setFooter();
});

function setFooter() {
   var docHeight = $( document ).height();
   var footerHeight = $('footer').height();
   var footerTop = $('footer').position().top + footerHeight;
   if (footerTop < docHeight) {
    $('footer').css('margin-top', (docHeight - footerTop) + 'px');
   }
}

$(document).ready(function() {
setFooter(); 
});
$(窗口)。调整大小(函数(){
setFooter();
});
函数setFooter(){
var docHeight=$(document).height();
var footerHeight=$('footer').height();
var footerTop=$('footer').position().top+footerHeight;
如果(页脚顶部<八){
$('footer').css('margin-top',(docHeight-footerTop)+'px');
}
}
$(文档).ready(函数(){
setFooter();
});

控制台中有任何消息吗?显示的代码中没有任何内容会因升级而中断。更有可能是其他插件不工作并阻止您的代码运行。请检查控制台是否有错误