简体   繁体   English

固定菜单并使用jQuery滚动到DIV

[英]Fixed Menu & Scroll to DIV with jQuery

im doing a page, I've manage to create a one page website, with a fixed menu. 我正在做一个页面,我设法用固定菜单创建了一个页面网站。

My problem: I want to add the scrollto.element jquery to my page, already tried Smint, Ariel Flesler and Infinty.js, none worked. 我的问题:我想将scrollto.element jQuery添加到我的页面,已经尝试了Smint,Ariel Flesler和Infinty.js,但都没有用。

Im new to jQuery but I think I can setup things with the guide/tutorial but its just not working. 我是jQuery的新手,但我认为我可以使用指南/教程进行设置,但它不起作用。

Can someone help out? 有人可以帮忙吗?

My Temporary Test Host: http://styleeuclides.site50.net/#home 我的临时测试主持人: http : //styleeuclides.site50.net/#home

If you're just looking to animate a scroll to an element, the following should do it: 如果您只是想为滚动元素添加动画效果,则应执行以下操作:

$('.button1').click(function() {
    $('html, body').animate({
        scrollTop:$('element-to-scroll-to').scrollTop()
    }, 250);
});

Something like that should do the trick. 这样的事情应该可以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM