Line 108: | Line 108: | ||
</div> | </div> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
− | + | $(function() { | |
− | + | // initialize skrollr if the window width is large enough | |
+ | if ($(window).width() > 767) { | ||
+ | skrollr.init(); | ||
+ | } | ||
+ | // disable skrollr if the window is resized below 768px wide | ||
+ | $(window).on('resize', function() { | ||
+ | if ($(window).width() <= 767) { | ||
+ | skrollr.init().destroy(); // skrollr.init() returns the singleton created above | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
$('#scrolldown').click(function(event) { | $('#scrolldown').click(function(event) { |
Revision as of 11:51, 4 August 2017