publishing
This commit is contained in:
parent
ba11d324f6
commit
5785cf72b1
17 changed files with 17 additions and 46 deletions
2
Yavsc/wwwroot/js/parallax.min.js
vendored
2
Yavsc/wwwroot/js/parallax.min.js
vendored
|
|
@ -1 +1 @@
|
|||
$(document).ready(function(t){var r=t(window),o=t(window).width(),a=t(window).height(),e=function(t,e,n){var g=t.data("speed"),s=(r.scrollLeft()+e-o/2)/g,i=(r.scrollTop()+n-a/2)/g,p=t.attr("orgbgpx")-Math.round(s),u=t.attr("orgbgpy")-Math.round(i),b=""+p+t.attr("orgbgpxu")+u+t.attr("orgbgpyu");t.css({backgroundPosition:b})},n=0,g=0;t('[data-type="background"]').each(function(){var r=t(this),s=r.css("backgroundPosition"),i=s.split(" "),p=i[0],u=i[1];/%$/.test(p)?(p=p.substr(0,p.length-1),r.attr("orgbgpxu","% ")):/em$/.test(p)?(p=p.substr(0,p.length-2),r.attr("orgbgpxu","em ")):/px$/.test(p)?(p=p.substr(0,p.length-2),r.attr("orgbgpxu","px ")):r.attr("orgbgpxu","px "),/%$/.test(u)?(u=u.substr(0,u.length-1),r.attr("orgbgpyu","% ")):/em$/.test(u)?(u=u.substr(0,u.length-2),r.attr("orgbgpyu","em ")):/px$/.test(u)?(u=u.substr(0,u.length-2),r.attr("orgbgpyu","px ")):r.attr("orgbgpyu","px "),r.attr("orgbgpx",parseInt(p)),r.attr("orgbgpy",parseInt(u)),t(window).scroll(function(){e(r,n,g)}),window.DeviceOrientationEvent&&(o>320&&a>320&&window.addEventListener("deviceorientation",function(t){n=o*Math.sin(t.gamma*Math.PI/180),g=a*Math.sin(t.beta*Math.PI/90),e(r,n,g)},!1),t(window).mousemove(function(t){n=t.pageX,g=t.pageY,e(r,t.pageX,t.pageY)}))})}(jQuery));
|
||||
$(document).ready(function(o){var u=o(window),p=o(window).width(),b=o(window).height(),a=function(t,r,e){var n=t.data("speed"),o=(u.scrollLeft()+r-p/2)/n,a=(u.scrollTop()+e-b/2)/n,g=t.attr("orgbgpx")-Math.round(o),s=t.attr("orgbgpy")-Math.round(a),i=""+g+t.attr("orgbgpxu")+s+t.attr("orgbgpyu");t.css({backgroundPosition:i})},g=0,s=0;o('[data-type="background"]').each(function(){var r=o(this),t=r.css("backgroundPosition").split(" "),e=t[0],n=t[1];/%$/.test(e)?(e=e.substr(0,e.length-1),r.attr("orgbgpxu","% ")):/em$/.test(e)?(e=e.substr(0,e.length-2),r.attr("orgbgpxu","em ")):(/px$/.test(e)&&(e=e.substr(0,e.length-2)),r.attr("orgbgpxu","px ")),/%$/.test(n)?(n=n.substr(0,n.length-1),r.attr("orgbgpyu","% ")):/em$/.test(n)?(n=n.substr(0,n.length-2),r.attr("orgbgpyu","em ")):(/px$/.test(n)&&(n=n.substr(0,n.length-2)),r.attr("orgbgpyu","px ")),r.attr("orgbgpx",parseInt(e)),r.attr("orgbgpy",parseInt(n)),o(window).scroll(function(){a(r,g,s)}),window.DeviceOrientationEvent&&(320<p&&320<b&&window.addEventListener("deviceorientation",function(t){g=p*Math.sin(t.gamma*Math.PI/180),s=b*Math.sin(t.beta*Math.PI/90),a(r,g,s)},!1),o(window).mousemove(function(t){g=t.pageX,s=t.pageY,a(r,t.pageX,t.pageY)}))})}(jQuery));
|
||||
Loading…
Add table
Add a link
Reference in a new issue