Added transition decade

This commit is contained in:
斟酌 鵬兄 2016-06-04 13:21:36 +08:00
parent 5b1955ced7
commit c739dfd76b
2 changed files with 7 additions and 2 deletions

View File

@ -234,13 +234,15 @@
Parallax.attach( window, wsupp, 0.5 );
var cp = 0;
var bWrapper = Dand.id( "begin-wrapper" );
Cycle.perma(
"MainBackground"
, function()
{
var p = wsupp.scrollTop / ( wsupp.scrollHeight - wsupp.clientHeight );
bWrapper.style.backgroundPosition = "50% " + ( p * 100 ) + "%";
cp = 0.75 * cp + 0.25 * p;
bWrapper.style.backgroundPosition = "50% " + cp * 100 + "%";
}
, 15
);

View File

@ -64,18 +64,21 @@
}
}
var cp = 0;
Cycle.perma(
"PARALLAXSCR"
, function()
{
var p = sSupplier.scrollTop/(sSupplier.scrollHeight - sSupplier.clientHeight);
cp = 0.85 * cp + p * 0.15;
for(var i = 0; i < l; i ++)
{
s = Parallax["s" + i];
for(var j = 0, k; j < s.length; j ++)
{
k = s[j];
k.element.style.top = String(-k.verticalRange*((j + 1)*p)) + "%";
k.element.style.top = String(-k.verticalRange*((j + 1)*cp)) + "%";
}
}
}