Coder Social home page Coder Social logo

bennyxguo / vuejs-scroll-fixed-header Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 22 KB

A simple cross browser supported vuejs2 scroll fixed header component

License: MIT License

HTML 68.41% JavaScript 29.53% Vue 2.06%
vuejs2 scroll-fixed-header fixed-header vue-component

vuejs-scroll-fixed-header's Introduction

Vuejs-scroll-fixed-header Component

Build Status Github starts License Npm downloads Npm version

一 Vue 2 scroll fixed header component

Demo 📙 中文文档 📙Changelog

Installation

npm i vuejs-scroll-fixed-header -S

Usage

Support

Supported Package Version
Vue 2.5+

Install component and Usage

Import component

// global register at main.js
import ScrollFixedHeader from 'vuejs-scroll-fixed-header';
Vue.use(ScrollFixedHeader);

Vue usage

<template>
  <scroll-fixed-header :fixed.sync="fixed" :threshold="56">
    <nav class="navbar navbar-light bg-light">
      <div class="container">
        <a class="navbar-brand" href="#">Vuejs Scroll Fixed Header</a>
      </div>
    </nav>
  </scroll-fixed-header>
</template>

<script>
export default {
  name: 'Timer',
  data() {
    return {
      fixed: false,
    };
  },
};
</script>

Props

Name Type Default Description
fixed Boolean false The fixed status of the current header
threshold Number 0 The scroll top threshold for determining the fixed status

Liscense

MIT License

Copyright (c) 2019 TriDiamond

vuejs-scroll-fixed-header's People

Contributors

bennyxguo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

vuejs-scroll-fixed-header's Issues

Not work in Safari

This library does not work in Safari.
It seems the getTargetTag method doesn't working well.

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.