jspro.com jspro.com

Bootstrap Native: Using Bootstrap Components without jQuery

Do you use Bootstrap’s JavaScript components? Do you like Vanilla JavaScript? Then you might be interested in the Native JavaScript for Bootstrap project (Bootstrap Native), which aims to remove the jQuery dependency required by the components by porting them to plain JavaScript. Why use Bootstrap Native? The motivations of such a port are mostly related to performance. One benefit is the potential performance gain that can come from...

jspro.com jspro.com

Native Infinite Scrolling with the IntersectionObserver API

Recently an interesting new client-side JavaScript API appeared on the Web Platform, the IntersectionObserver API. This tiny but useful API provides a means to efficiently monitor (observe) the visibility of specified DOM elements, that is, when they are in or out of a viewport (the viewport of the browser window or of an element). The definition of element visibility can be made precise specifying the fraction of the area of the...

jspro.com jspro.com

How to Implement Smooth Scrolling in Vanilla JavaScript

Smooth scrolling is a user interface pattern that progressively enhances the default in-page navigation experience, animating the change of position within the scroll box (the viewport, or a scrollable element) from the location of the activated link to the location of the destination element indicated in the hash fragment of the link URL. This is nothing new, being a pattern known from many years now, check for instance this SitePoint...