Line 144: | Line 144: | ||
<script> | <script> | ||
− | var distance = $('.title | + | $(document).ready(function() { |
+ | var distance = $('.title').innerHeight(), | ||
$window = $(window); | $window = $(window); | ||
− | console.log( | + | console.log(distance); |
$window.scroll(function() { | $window.scroll(function() { | ||
Line 153: | Line 154: | ||
console.log('on top'); | console.log('on top'); | ||
} | } | ||
+ | }); | ||
}); | }); | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 09:44, 13 October 2016