mirror of
https://github.com/offen/website.git
synced 2024-11-22 09:00:28 +01:00
prevent out of bounds opacity values
This commit is contained in:
parent
b493f1c8f8
commit
8f5bc24fd1
@ -1,7 +1,8 @@
|
||||
;(function ($) {
|
||||
$(document).ready(function () {
|
||||
$(window).scroll(function () {
|
||||
$('.brand-index').css('opacity', 0 + $(window).scrollTop() / 100)
|
||||
var scrollProgress = parseInt($(window).scrollTop(), 10)
|
||||
$('.brand-index').css('opacity', Math.min(scrollProgress / 100, 1))
|
||||
})
|
||||
})
|
||||
})(window.jQuery)
|
||||
|
Loading…
Reference in New Issue
Block a user