Giter Club home page Giter Club logo

fixedscroll's Introduction

fixedScroll

基本满足常见的网页fixed需求。

功能场景

  1. 滚动时固定元素
  2. 锚点菜单定位

演示地址

演示:Demo1Demo2Demo3Demo4

官方地址:[点这里]

使用说明

1.引入必要文件:jQuery、fixedScroll.js 。

<script src="jquery.js"></script>
<script src="fixedScroll.js"></script>

2.基础用法

$(".box").fixedScroll()

3.参数

navEls : nav类名
hookEls : 点击nav滚动到对应的元素
hookOffset : 滚动元素的顶部偏移量
offset : 固定元素的顶部偏移量
stickEndEl : 固定元素结束位置
callback(isFixed) : 滚动时触发,返回值isFixed为true表示已固定,false没固定

4.方法

resizeHeight()  : //高度变化时重新计算

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.