基本的Jquery不工作不知道为什么......你能帮助我吗? [英] Basic Jquery dont work dont know why...can you help me?

查看:67
本文介绍了基本的Jquery不工作不知道为什么......你能帮助我吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我开始研究Jquery,我试着做一个基本的例子。 
我有一个html文件index.html和其他functions.js。
在index.html中我有一些菜单,内容和文字。
在functions.js中,我有上面的这个功能。
但是当我点击我的链接时footer-top无效。
应该是什么问题?


< section id = footer1 >
< a href = class = footer-top > 返回页首< / a >
< / section >


$(document).ready(function(){
$('。top')。click(function(){
$('html, body')。animate({scrollTop:0},'slow');
})
});

解决方案

(document).ready(function(){

('。top')。click(function(){


('html,body')。animate({scrollTop:0},'慢');
})
});


Hello, im starting study Jquery and im trying to do a basic example.
I have a html file index.html and other functions.js.
In the index.html i have some menus, content and text.
In the functions.js i have this function above.
But when i click in my link "footer-top" is not working.
What should be the problem?


    <section id="footer1">
           <a href="#" class="footer-top">Go To Top</a>
    </section>


    $(document).ready(function() {
       $('.top').click(function(){
       $('html,body').animate({ scrollTop: 0 }, 'slow');
        })
     });

解决方案

(document).ready(function() {


('.top').click(function(){


('html,body').animate({ scrollTop: 0 }, 'slow'); }) });


这篇关于基本的Jquery不工作不知道为什么......你能帮助我吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆