Skip to main content Skip to secondary navigation Accessibility Feedback

Rewriting scripts for better developer flexibility

Last week, the full suite of JavaScript add-ons for Kraken got a few updates that provide much greater flexibility for developers (while still being easy to use right out-of-the-box).

What’s new?

  1. The old versions self-initialized. You have to initialize them now, which means you can concatenate them all into a single file and only call them when needed. It also means you can reinitialize them if the DOM gets modified.
  2. You can pass in your own options and callbacks into the scripts via the init() function, which gives you more control.
  3. On scripts where it makes sense (Smooth Scroll, for example), you can set overrides on individual elements.
  4. Key functions in the scripts can now be used in your own scripts, which allows you to extend and build upon the scripts without messing with the core code.

I’ll be writing up a tutorial on the approach soon, but in the meantime, check out the full set of scripts on GitHub.

  • More articles on...
  • Code

Have any questions or comments about this post? Email me at chris@gomakethings.com or contact me on Twitter at @ChrisFerdinandi.

Get Weekly Digests