Git Product home page Git Product logo

stickup's Introduction

stickUp

a jQuery plugin

A simple plugin that "sticks" an element to the top of the browser window while scrolling past it, always keeping it in view. This plugin works on multi-page sites, but has additional features for one-pager layouts.

Please Visit the GitHub Page for installation instructions.

stick up 插件升级(可以理解为v2.0)

作出如下修改:

  • 舍弃parts参数,更改为在html标签中指定data-menu属性的形式

添加如下功能:

  • 支持回调函数,如afterStick等
  • 支持多次调用(原版本下,仅保存最后一次调用信息,即不支持多次调用)
  • 引入严格模式

调用接口如下

  • dataProperty:默认值:data-menu,用于标注menu-item中的(此值与html结构关联,用于替代以前的parts参数)
  • itemClass: 标注菜单“项”,在库中通过此参数查找菜单项
  • itemHover: 单页网页中,网页滚动到菜单项指定区域时,会为该菜单项添加该类
  • marginTop: 用于指定滚动元素到上边距
  • beforeStick: 回调函数,菜单栏固定前触发
  • afterStick: 回调函数,菜单栏固定后触发
  • beforeUnstick: 回调函数,菜单栏解除固定前触发
  • afterUnstick: 回调函数,菜单栏解除固定后触发
如果有任何问题,请尽快联系我;如果可能,请尽量阅读源码,不多,才150多行

stickup's People

Contributors

vanmess avatar lirancohen avatar

Watchers

hughZhuang 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.