Scroll to anchor with offset when coming from another page
Hi there, Thanks for writing in. That code is for links that directly clicked but not for the page that is loaded. You'll need to add another set of code like this jQuery ( document ).ready ( function($) { var hash= window.location.hash if ( hash == '' || hash == '#' || hash == undefined ) return false; var target = $(hash); headerHeight = 120; target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { ...
Native browser smooth scrolling is like this: // Scroll to specific values // scrollTo is the same window.scroll({ top: 2500, left: 0, behavior: 'smooth'
LazyLoad is a fast, lightweight and flexible script that speeds up your web application by loading images only as they enter the viewport. LazyLoad supports responsive images.
A common UI pattern that we see on the web are dropdown menus. They’re used to display related information in pieces, without overwhelming the user with buttons, text, and options. Somewhere that we see these a lot is inside of headers or navigation areas on websites. Let’s see if we can make one of these menus with CSS alone.
Solved with CSS! Logical Styling Based on the Number of Given Elements | CSS-Tricks
Did you know that CSS is Turing complete? Did you know that you can use it to do some pretty serious logical styling? Well you can! You don’t have to set all of your logic-based styling rules in JavaScript, or even have to use JavaScript to set classes you are styling against. In many cases, CSS can handle that itself. I’m still discovering new CSS tricks everyday, and it just makes me love it even more.
CSS animations are rad and the concept is fairly simple. Name the animation, define the movement in @keyframes and then call that animation on an element.
Building A Static Site With Components Using Nunjucks
Even if you don’t use any client-side JavaScript at all to build a site, it doesn’t mean you have to give up on the idea of building with components. Learn how to build a static site with the help of …
Nunjucks calls itself "A rich and powerful templating language for JavaScript", which sounds about right. It's not intentionally super lightweight like
My book publisher forwarded some interview questions to me from a British magazine a while back. One of the questions was, "Why would people want to make their own body care products instead of buying
If you haven’t had the chance to watch it yet, Paul Lewis put together an awesome video series that demonstrates how to build a media player alongside some of the great features of Progressive Web App…
I'm having a tough time getting this to work. I have a string like: something/([0-9])/([a-z]) And I need regex or a method of getting each match between the parentheses and return an array of mat...
There are instances where I would like to revert and uninstall all previous gem installations. For instance, I needed to assist a friend migrate their rails development machine to use RVM. As the...
I have never had a default installation of Ruby gems on Mac OS X let me simplyinstall new gems without requiring sudo. If you would like to install Ruby gems...
Update: whilst this post is still useful, I now recommend that people use rvm to manage their gems, which makes the following post redundant as rvm allows you to quickly and easily delete gemsets at w…
This video teaches you how to install the latest version of Ruby on your macOS computer. Using a tool called rbenv makes installing the latest (and multiple)...