-
Notifications
You must be signed in to change notification settings - Fork 0
/
lilt.min.js
6 lines (6 loc) · 1.13 KB
/
lilt.min.js
1
2
3
4
5
6
/*!
* lilt.js v0.1 (https://github.com/jimmylorunning/lilt.js)
* Copyright (c) 2015
* Licensed under MIT (https://github.com/jimmylorunning/lilt.js/LICENSE)
*/
!function(s){s.fn.liltMoveShadow=function(o){return this.each(function(){var t=s.extend({"horizontal-offset":"-20px","blur-radius":"40px","spread-radius":"0px","shadow-color":"#999999",subtleness:"7"},o,{"horizontal-offset":s(this).data("horizontal-offset"),"blur-radius":s(this).data("blur-radius"),"spread-radius":s(this).data("spread-radius"),"shadow-color":s(this).data("shadow-color"),subtleness:s(this).data("subtleness")});t.subtleness<1&&(t.subtleness=1),scrollYPos=s(window).scrollTop(),boxYPos=s(this).offset().top,verticalOffset=Math.ceil((boxYPos-scrollYPos)/t.subtleness),shadowStyle=t["horizontal-offset"]+" "+verticalOffset+"px "+t["blur-radius"]+" "+t["spread-radius"]+" "+t["shadow-color"],s(this).css("box-shadow",shadowStyle),s(this).css("-moz-box-shadow",shadowStyle),s(this).css("-webkit-box-shadow",shadowStyle)})}}(jQuery),function(s,o){s.fn.lilt=function(t){s(".lilt").liltMoveShadow(t),s(o).scroll(function(){s(".lilt").liltMoveShadow(t)})}}(jQuery,window,document);