Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.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 - Fatal编程技术网

Javascript 返回顶部的jquery帮助

Javascript 返回顶部的jquery帮助,javascript,jquery,Javascript,Jquery,为什么这不起作用 <script type="text/javascript"> jQuery.noConflict(); jQuery(document).ready(function(){ if( jQuery(".page").height() < jQuery(window).height() ) { jQuery(".backtop").hide(); } else { jQuery(".backtop").s

为什么这不起作用

<script type="text/javascript">     
jQuery.noConflict();

jQuery(document).ready(function(){
   if( jQuery(".page").height() < jQuery(window).height() ) {
       jQuery(".backtop").hide();
   }
   else {
       jQuery(".backtop").show();
   }
});
</script>

jQuery.noConflict();
jQuery(文档).ready(函数(){
if(jQuery(“.page”).height()
我使用两个框架,mootools和jquery。我不知道如何使用mootools,它一定在那里。我对jquery略知一二,只想在主体(.page)大于窗口时显示“返回顶部”按钮

有人能帮我吗

编辑:有人能给我一个类似的脚本吗?


此代码有效。我从

复制了此代码。backtop是类还是元素的id?要访问id,请尝试$(“#backtop”).hide()

祝你好运。
--Joe

你试过
if(jQuery(document).height()
吗?我现在唯一能推荐的就是打印(使用
console.log()
jQuery(.page”).height()
jQuery(window.height()
或者创建一个删除了工具的测试页面。这两个库之间有轻微但可能发生冲突。