Tumblr-like Sticky Video Plugin With Pure JavaScript

Category: Javascript | March 12, 2018
Author: afuggini
Views Total: 400
Official Page: Go to website
Last Update: March 12, 2018
License: MIT

Preview:

Tumblr-like Sticky Video Plugin With Pure JavaScript

Description:

A pure JavaScript plugin which makes your videos (for example Youtube & Vimeo videos) and even any elements sticky at the of the bottom of the webpage when you scroll past them. Similar to the Tumblr‘s sticky video function.

How to use it:

Include the following JavaScript and CSS files on the web page.

<link rel="stylesheet" href="css/sticky.css">
<script src="js/sticky_video.js"></script>

Embed a Youtube video into the sticky container.

<div id="sticky-container">
  <iframe class="sticky-container__object" src="https://www.youtube.com/embed/yMMz2VwbhVI?enablejsapi=1&amp;rel=0&amp;showinfo=0&amp;controls=0&autoplay=1" frameborder="0" height="270" width="480" allow="autoplay; encrypted-media"></iframe>
</div>

Initialize the StickyVideo library and done.

new StickyVideo('sticky-container')

Leave a Reply