Team:KIT-Kyoto/Test

From 2014.igem.org

(Difference between revisions)
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>

Revision as of 08:10, 6 October 2014

Welcome to KIT-Kyoto Wiki Page!

This is our wiki page.

About us

About our team members,our university,and so on...

Project

You want to know our project details, click here.

Modeling

Modeling



kit