Created
November 6, 2015 16:04
-
-
Save yoon/3c0adf18216f09219a27 to your computer and use it in GitHub Desktop.
jQuery script to repeatedly scroll through a mailchimp html email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pageZoom = '.9'; | |
| var pixelsPerSecond = 10; | |
| $('#awesomewrap').hide(); // hide email header | |
| $('html').css('zoom', pageZoom); // zoom out the page | |
| var scrollHeight = $(document).height() - $(window).height(); | |
| var scrollThrough = function(){ | |
| $('html, body').animate({scrollTop: 0}, 1).animate({ scrollTop: scrollHeight }, scrollHeight * 1000 / pixelsPerSecond, "linear", scrollThrough); | |
| }; | |
| var stopScroll = function(){ | |
| $('html, body').stop(); | |
| }; | |
| scrollThrough(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment