注释àla“点击出现”用jQuery [英] Comments à la "click to appear" with jQuery

查看:87
本文介绍了注释àla“点击出现”用jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WordPress博客,我试图让用户点击显示评论评论部分出现一个简单的动画..我使用

I have a WordPress blog and I'm trying to make that when a user clicks on "Show comments" the comments section appears with a simple animation.. I used

 <a href="#comments" id="showcomments">Show comments</a>

,然后:

<script type="text/javascript">
jQuery(function(){
jQuery("#showcomments").click(function () {
    jQuery("#comments").slideToggle("slow");
});
});
</script>

<div id="comments" style="display:none">
    ......
    </div>

这是我实现的(向下滚动到Commenta l'articolo! b http://multiformeingegno.it/riflessioni/topserver-server-virtuali-made -italy /

This is what I achieved (scroll down to "Commenta l'articolo!"): http://multiformeingegno.it/riflessioni/topserver-server-virtuali-made-italy/

正如您所看到的,如果我单击链接,评论部分出现,但浏览器不会下降到部分的开始,你必须手动向下滚动..你能帮我吗?谢谢!! ;)

As you can see if I click the link the comments section appears but the browser doesn't go down to the start of the section, you have to manually scroll down.. can you help me? Thanks!! ;)

推荐答案

上面的DIV idcomments,输入以下代码:

Above DIV id "comments", put the following code:

<a name="comments">

您需要指向用户点击后要去的地方。

You need to point where you want the user to go after the click.

祝你好运! :)

这篇关于注释àla“点击出现”用jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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