Giter VIP home page Giter VIP logo

scroll-sticker's Introduction

Sticker

贴靠组件

使用

条件:贴靠目标不能被positionabsoluterelative的元素包裹。

常用组件:

  • alwaysStickLeft x 方向永远贴靠在参考元素的左侧
  • alwaysStickRight x 方向永远贴靠在参考元素的右侧
  • toTopAndBottomDistance y 方向永远处于距页面顶部 top 个像素以下、页面底部 bottom 个像素以上
  • yBetweenTwoRef y 方向永远处于参考元素 1 和参考元素 2 之间

事件注册器:

  • scrollRegister x 方向永远贴靠在参考元素的左侧,返回注销事件函数,下同
  • resizeRegister x 方向永远贴靠在参考元素的左侧

可组合组件:

  • getElemPos 获取目标距离页面左上角的 x 方向和 y 方向的距离。返回{ x: number, y: number }
  • windowWidth 获取窗口宽度,返回number像素,下同
  • windowHeight 获取窗口高度
  • refWidth 获取 dom 宽度
  • refHeight 获取 dom 高度
  • ref1BottomToRef2Top 从 ref1 底部到 ref2 顶部的距离
  • refRightToScreenLeft 从 dom 右侧到屏幕左侧的距离
  • refLeftToScreenLeft 从 dom 左侧到屏幕左侧的距离
  • refBottomToScreenTop 从 dom 底部到屏幕顶部的距离
  • refTopToScreenTop 从 dom 顶部到屏幕顶部的距离
  • refRightToScreenRight 从 dom 右侧到屏幕右侧的距离
  • refLeftToScreenRight 从 dom 左侧到屏幕右侧的距离
  • refBottomToScreenBottom 从 dom 底部到屏幕底部的距离
  • refTopToScreenBottom 从 dom 顶部到屏幕底部的距离

scroll-sticker's People

Contributors

bloss0mx avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.