Last Updated: May 15, 2019
· takaya213


I came across an interesting concept today, called Hook.js.

It allows you to implement a scroll up refresh, similair to what you find on most tablets and smartphones.

Hook.js implements this functionality quite simply into your website. Just copy the js file to your website and add they styles, as well as a small amount of code to the top of your website, just below the <body> tag.

You will first need to download the files here.

Place the following right before </head>:

<script src="" type="text/javascript"></script>
<link rel="stylesheet" href="hook/hook.css" type="text/css" />
<script src="hook/hook.js" type="text/javascript"></script>

Place the following right after <body>:

<div id="hook">
    <div id="loader">
        <div class="spinner"></div>
    <span id="hook-text">Reloading...</span>

The only thing that I think should be looked at, is the smoothness of the transition of the scroll down refresh, its a little bit abrupt, but overall it is an interesting concept to look into adding to ones website as a nice to have.