Coder Social home page Coder Social logo

webbrandon / bootstrap.jquery.scrollfade.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from themindcompany/bootstrap.jquery.scrollfade.js

0.0 2.0 0.0 182 KB

Bootstrap Plugin for Jquery Scrollfade

JavaScript 74.15% CSS 13.33% HTML 12.52%

bootstrap.jquery.scrollfade.js's Introduction

bootstrap.jquery.scrollfade.js

Bootstrap Plugin for Jquery Scrollfade
Author: @Brandon L. Clark [email protected]

#Description This is a plugin for those who wish to use the navbar component of Bootstrap because they are using the Scrollfade plugin for jquery. It acts like scrollspy.js but because of the way Scrollfade embeds data to perform its visual effect scrollspy will not work. It also adds a smooth scroll effect for same page navigation.

#Requires

#Example You can find an example file in this repository. Feel free to use and modify the code.

#How to use bootstrap.jquery.scrollfade CSS

Two elements need to be given positioning and size settings. The body needs to be fixed to all borders or Scrollfade will not work. #content-scroll needs to be relative so the content area can be correctly sized to navbar.

body {
  position:fixed;
  top:0;
  bottom:0;
  left:0;
  right:0;
  padding-bottom:50px;
  height:100%;
}
#content-scroll {
  overflow:auto;
  position:relative;
  margin-top:50px;
  height:100%;
}

HTML

The basic html structure is simliar to that needed to create a Bootstrap navbar component. The content needs to be nested in a element after the navigation. (Note: Bootstrap classes have been left out)

<body>
  <nav>
    ...
  </nav>
  <div id="content-scroll">
    ... (Sections are given trigger class to notify nav, example uses .sh)
  </div>
</body>

JavaScript

You need to target the element that has your nested content (eg: $('#content-area').scrollfade() ). To init bootstrap.jquery.scrollfade.js add .scrollfadeBootstrap() with your navigation sections target component after scrollfade().

$(function(){
  $('#content-scroll').scrollfade().scrollfadeBootstrap('.sh');
});

bootstrap.jquery.scrollfade.js's People

Watchers

 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.