Giter Site home page Giter Site logo

Comments (3)

baptistebriel avatar baptistebriel commented on May 20, 2024

Hi there,

Sorry for the late answer! If you're not using ES6 or extending the base class of Smooth you can still use the basics by loading smooth-scrolling.min.js.

See this demo; there's no additional JavaScript classes, only the required code to initialise it.
Passing a run function to the options will do nothing, as it's not listed in the README.

Passing divs in the options using smooth-scrolling.min.js will do not work either because this snippet has been taken from another demo that has other options.

There's a few other ways to extend a function prototype; have a read here on MDN and on Stack Overflow. If you can implement ES6 + babel, I'd recommend it. ES6 has just simpler ways to do the same thing we do in ES5, like extending a function's prototype.

from smooth-scrolling.

adamjw3 avatar adamjw3 commented on May 20, 2024

Been looking more at es6 so adding this to my workflow using grunt. Looking at using browserfy with babel transform. What do you use?

I've seen that a lot of people either do one bundle across all pages or attempt to split the bundle into pages. What do you do?

from smooth-scrolling.

baptistebriel avatar baptistebriel commented on May 20, 2024

Hey @adamjw3, sorry for replying one year later. 😅
You can have a look at the package.json of this repository, I'm using simple npm scripts. Obviously, you'd rather use grunt/gulp or webpack for bigger projects.

from smooth-scrolling.

Related Issues (20)

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.