mirror of
https://github.com/offen/website.git
synced 2024-11-22 17:10:29 +01:00
prevent out of bounds opacity values
This commit is contained in:
parent
b493f1c8f8
commit
8f5bc24fd1
@ -1,7 +1,8 @@
|
|||||||
;(function ($) {
|
;(function ($) {
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$(window).scroll(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)
|
})(window.jQuery)
|
||||||
|
Loading…
Reference in New Issue
Block a user