Skip to content

Instantly share code, notes, and snippets.

Avatar

Pablo Armentano pabliqe

View GitHub Profile
@pabliqe
pabliqe / gist:50408d797e2a3425628ef56ee7f54ae5
Last active Sep 19, 2017
Bookmarklet to scroll a webpage automatically
View gist:50408d797e2a3425628ef56ee7f54ae5
javascript:(function(){
/* tired of scrolling? try this... */
var lazyScroll = setInterval(function() {
window.scrollTo(0, window.pageYOffset+1);
}, 0);
})();
View smooth-scroll-to.js
// usage smoothScrollTo.call([NodeElement])
function smoothScrollTo(completeCallback) {
// center element on screen
var posY = window.pageYOffset - (window.innerHeight / 2) + this.getBoundingClientRect().top + (this.offsetHeight / 2);
scrollAnimator = TweenLite.to(window, 1, {
scrollTo: {
y: posY
},
onComplete: function(){
View chosen-reset.css
/**
* This styles are the minimal essential properties
* to get chosen working without extra styling
* that you are going to override later
*/
.chosen-container {
position: relative;
display: -moz-inline-stack;
display: inline-block;
*vertical-align: auto;
View w-slider-controller.js
/**
* Extends Webflow Slider with public methods to swich between slides
*
* Paste this code on the Custom Code panel to get started:
*
* var slider = new W_SLIDER_CONTROLLER( '#element_id' );
* slider.setup('drag_disabled') // removes the drag-and-slide interaction
* slider.goto( 2 ); // jumps to the second slide
*/
var W_SLIDER_CONTROLLER = function( el ){