JSFiddle - React, Tailwind, and code Playground

by seankoole

JavaScript

var $win = $(window),
		width = $win.width(),
    height = $win.height()
    top = $win.scrollTop()
    offsetTop = offset.top
    $socials = $('.share-socials');

$win.scroll(function() {
  // single blog socials
  if ((height > 0) && (width > 998)) {
    if (top > offsetTop && top < content) {
      $socials.stop().animate({
        marginTop: top - offsetTop + topPadding
      });
    } else if (top < offsetTop) {
      $socials.stop().animate({
        marginTop: 0
      });
    } else {
      $socials.stop();
    }
  }
});