Welcome to KIT-Kyoto Wiki Page!
This is our wiki page.
Line 209: | Line 209: | ||
} | } | ||
}); | }); | ||
+ | |||
+ | var $window = $(window); | ||
+ | |||
+ | $('.top-content').each(function(index) { | ||
+ | var $self = $(this); | ||
+ | var offsetCoords = $self.offset(); | ||
+ | |||
+ | $(window).scroll(function() { | ||
+ | // If this section is in view | ||
+ | if (($window.scrollTop() + $window.height()) > offsetCoords.top && ((offsetCoords.top + $self.height()) > $window.scrollTop())) { | ||
+ | var yPos = -($window.scrollTop() / 8); | ||
+ | if ($self.attr('id') != 'top-first') { | ||
+ | yPos += 126; | ||
+ | } | ||
+ | var coords = '50%' + yPos + 'px'; | ||
+ | $self.css('backgroundPosition', coords); | ||
+ | |||
+ | // Check for other sprites in this section | ||
+ | $('.sprite', $self).each(function(index) { | ||
+ | var $sprite = $(this); | ||
+ | var yPos = -($window.scrollTop() / $sprite.data('speed')) + $sprite.data('offsety'); | ||
+ | $sprite.css('top', yPos); | ||
+ | }); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
}); | }); | ||
</script> | </script> |
KIT-Kyoto
This is our wiki page.
About our team members,our university,and so on...
You want to know our project details, click here.
Modeling