Permalink
Browse files

made the ie plugin compatible to our jshint rules

  • Loading branch information...
1 parent 8e6b97d commit 6f0ec000e37ca1a7d47713be471ee42d9b514c4f @Prinzhorn committed Aug 15, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 plugins/skrollr.ie.js
View
11 plugins/skrollr.ie.js
@@ -16,6 +16,7 @@
skrollr.plugin('setStyle', function(el, prop, val) {
var style = el.style;
+ var matched;
//IE opacity
if(prop === 'opacity') {
@@ -33,7 +34,7 @@
//Fast pre check
if(val.indexOf('hsl') > -1) {
- var matched = false;
+ matched = false;
//Replace hsl(a) with hex if needed (ignoring alpha).
val = val.replace(rxHSLAColor, function(x, h, s, l) {
@@ -51,7 +52,7 @@
//Fast pre check
if(val.indexOf('rgb') > -1) {
- var matched = false;
+ matched = false;
//Replace rgba with hex if needed (ignoring alpha).
val = val.replace(rxRGBAColor, function(s, r, g, b) {
@@ -88,16 +89,16 @@
//Based on https://gist.github.com/1325937 and https://gist.github.com/983535
hsl: function(a,b,c,y){
a%=360;
- a/=60;c/=100;b=[c+=b*=(c<.5?c:1-c)/100,c-a%1*b*2,c-=b*=2,c,c+a%1*b,c+b];
+ a/=60;c/=100;b=[c+=b*=(c<0.5?c:1-c)/100,c-a%1*b*2,c-=b*=2,c,c+a%1*b,c+b];
y = [b[~~a%6],b[(a|16)%6],b[(a|8)%6]];
- return toHex.rgb(parseInt(y[0] * 255), parseInt(y[1] * 255), parseInt(y[2] * 255));
+ return toHex.rgb(parseInt(y[0] * 255, 10), parseInt(y[1] * 255, 10), parseInt(y[2] * 255, 10));
},
//https://gist.github.com/983535
rgb: function(a,b,c){
return'#' + ((256+a<<8|b)<<8|c).toString(16).slice(1);
}
- }
+ };
}(window.skrollr));

0 comments on commit 6f0ec00

Please sign in to comment.