zoukankan      html  css  js  c++  java
  • div 滚动定位代码


            var thisheith;
            $(function () {
                var divid = '#14681-121320-197209';
                $(divid).find("a").addClass("c-red").addClass("b");
                $(divid).bind("click", function () {
                    change(this);
                });
                $(divid).click();
                ScrollDiv();
            });
            function ScrollDiv() {
                var ex = document.getElementById("nav");
                ex.scrollTop = thisheith-200;
            }
            function change(elem) {
                thisheith= getTop(elem);
            }
            function getTop(e) {
                var offset = e.offsetTop;
                if (e.offsetParent != null) {
                    offset += getTop(e.offsetParent);
                }
                return offset;

            }

  • 相关阅读:
    day006 数字类型和字符串类型的内置方法
    awk技巧 nginx access.log
    测试访问速度
    ELK Deployed
    jenkins权限控制
    linux 系统优化
    nginx 刷新显示404
    虚拟机安装的ubutun全屏
    在线生成二维码
    GIT 命令集
  • 原文地址:https://www.cnblogs.com/wdkshy/p/4243705.html
Copyright © 2011-2022 走看看