Skip to content

Instantly share code, notes, and snippets.

Scott Polhemus ScottPolhemus

Block or report user

Report or block ScottPolhemus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ScottPolhemus
ScottPolhemus / continuallyScroll.js
Created Apr 20, 2017
Continually scroll to the bottom of a page
View continuallyScroll.js
var scrolling
function scrollToBottom() {
if (scrolling)
requestAnimationFrame(scrollToBottom)
window.scrollTo(0, document.body.offsetHeight)
}
function startScrolling() {
@ScottPolhemus
ScottPolhemus / typekit-finish.js
Last active May 9, 2016
Fires a custom event on the page as soon as Typekit finishes loading or fails to load. Add this in place of the standard Typekit.load() snippet to enable listening for the event in your own JS (useful for controlling how text appears on page load).
View typekit-finish.js
function triggerTypekitFinish() {
if (typeof window.CustomEvent === 'function') {
var event = new CustomEvent('typekit-finish');
} else {
var event = document.createEvent('CustomEvent');
event.initCustomEvent('typekit-finish', true, true, {});
}
document.documentElement.dispatchEvent(event);
}
try {
@ScottPolhemus
ScottPolhemus / _mixins.scss
Last active Aug 29, 2015
A collection of SASS mixins.
View _mixins.scss
// SASS Mixins
// -----------
// Force an element to fill its container
@mixin fill {
position: absolute;
top: 0; bottom: 0;
left: 0; right: 0;
}
@ScottPolhemus
ScottPolhemus / mixins.less
Last active Aug 12, 2018
A collection of LESS mixins.
View mixins.less
//
// LESS Utility Mixins
// -------------------
// Fill the parent element
.fill(@spacing: 0) {
position: absolute;
top: @spacing; bottom: @spacing;
left: @spacing; right: @spacing;
}
@ScottPolhemus
ScottPolhemus / scrollerScroll.js
Last active Dec 15, 2015
Scroll property plugin for Stellar.js to use Zynga Scroller for scrolling.
View scrollerScroll.js
$.stellar.scrollProperty.scrollerScroll = {
getLeft: function($elem) { return scroller.getValues().left; },
setLeft: function($elem, val) { scroller.scrollTo(val); },
getTop: function($elem) { return scroller.getValues().top; },
setTop: function($elem, val) { scroller.scrollTo(null, val); }
}
You can’t perform that action at this time.