JavaScript-scrolling the page to the appropriate location navigation bar also triggers the corresponding effect

Source: Internet
Author: User

Scroll to the left of the work experience navigation bar that blue circle to work experience left
What happened with jquery?

Reply content:

Scroll to the left of the work experience navigation bar that blue circle to work experience left
What happened with jquery?

When scrolling, the offettop of each block is detected, and the navigation style is activated when the top is less than a certain number.

Bootstrap Scrollspy.js, you can refer to the following

http://v3.bootcss.com/javascript/#scrollspy

This is what I wrote a long time ago, it should be OK.

//jquery v1.8.3$(window).scroll(scrollto); //判断滚动条滚动了,执行scrollto()function scrollto(){    var scroll_top = $(window).scrollTop(); //获取到滚动条距离顶部的位置(应该是,嘿嘿),你算好滚动到工作经历是多少的数值,然后进行if判断,大于这个数值了就对左侧列表的原点进行操作。    $(".float").stop().animate({top:scroll_top}); //这是我要进行的操作}
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.