zoukankan      html  css  js  c++  java
  • 当前节点获取位置汇总

    $(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");
    
  • 相关阅读:
    XP显示桌面
    批量改名
    poj 3126 BFS
    poj 3278 BFS
    poj 1426 BFS
    准备打酱油…
    POJ 2243 BFS 和 简单的调试方法学习
    K
    EXCEL fundamentals
    poj 1011 DFS+剪枝
  • 原文地址:https://www.cnblogs.com/xyzhuzhou/p/3468869.html
Copyright © 2011-2022 走看看