• 当前节点获取位置汇总


    $(this).offset().top; //当前节点距离顶端高度
    $(window).height(); //当前浏览器窗口高度
    $(window).scrollTop(); //被隐藏的上部 高度
    $("html,body").height(); //当前页面高度 
    node.height(); //当前节点高度

     示例:

    var node = $(this).find("div[class='category_over_box']"); //节点 
    var nodeHeight = node.height(); //当前节点高度
    var currentTop = $(this).offset().top; //当前节点距离顶端高度
    var currentWinHidHeight = $(window).scrollTop(); //被隐藏的上部 高度
    var currLastHeight = currentTop - currentWinHidHeight; //剩余高度 
    node.css("top", "-" + (currLastHeight - 40) + "px");
    
  • 相关阅读:
    枚举
    枚举
    比特币中的密码学原理
    贪心
    dp
    二分
    mac解决matplotlib中文乱码
    Keras使用多个GPU并行
    pyspark使用-dataframe操作
    箱线图
  • 原文地址:https://www.cnblogs.com/xyzhuzhou/p/3468869.html
Copyright © 2020-2023  润新知