Permalink
Browse files

patching for complete trapezium support across Opera and IE. Pre-majo…

…r refactor to drop userAgent testing
  • Loading branch information...
1 parent 085311e commit e151f83287f4814f922e4822c5bdb7c2c9b6a6f6 @addyosmani addyosmani committed Apr 18, 2011
Showing with 55 additions and 13 deletions.
  1. +2 −0 css/demos.css
  2. +1 −1 index.html
  3. +16 −0 js/jquery-1.5.1.min.js
  4. +36 −12 js/ui.coverflow.js
View
@@ -372,6 +372,8 @@ div.wrapper {
display: inline-block;
height: 600px;
width: 2600px;
+>width:2900px;
+>margin-left:-200px;
padding: 42px;
position: absolute;
top: 0px;
View
@@ -100,7 +100,7 @@
<div class="pageWrapper">
-<h1>jQuery UI CSS3 CoverFlow 2.1</h1>
+<h1>jQuery UI CSS3 CoverFlow 2.1.1</h1>
<div class="demo">
<div class="wrapper">
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -10,7 +10,8 @@
var browserVersion = $.browser.version.replace(/^(\d+\.)(.*)$/, function() { return arguments[1] + arguments[2].replace(/\./g, ''); });
- var supportsTransforms = !($.browser.mozilla && (parseFloat(browserVersion) <= 1.9)) && !$.browser.opera;
+ //var supportsTransforms = !($.browser.mozilla && (parseFloat(browserVersion) <= 1.9)) && !$.browser.opera;
+ var supportsTransforms = !($.browser.mozilla && (parseFloat(browserVersion) <= 1.9));
$.easing.easeOutQuint = function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
@@ -121,17 +122,40 @@
before = (i > from && i != to),
css = { zIndex: self.items.length + (side == "left" ? to-i : i-to) };
-
- css[($.browser.safari ? 'webkit' : 'Moz')+'Transform'] = 'matrix(1,'+(mod * (side == 'right' ? -0.2 : 0.2))+',0,1,0,0) scale('+(1+((1-mod)*0.3)) + ')';
-
- css[self.props[2]] = ( (-i * (self.itemSize/2)) + (side == 'right'? -self.itemSize/2 : self.itemSize/2) * mod );
-
-
- if(!supportsTransforms) {
- css.width = self.itemWidth * (1+((1-mod)*0.5));
- css.height = css.width * (self.itemHeight / self.itemWidth);
- css.top = -((css.height - self.itemHeight) / 2);
- }
+
+// css[($.browser.safari ? 'webkit' : 'Moz')+'Transform'] = 'matrix(1,'+(mod * (side == 'right' ? -0.2 : 0.2))+',0,1,0,0) scale('+(1+((1-mod)*0.3)) + ')';
+ css[($.browser.safari ? 'webkit' : ($.browser.opera ? 'O' : 'Moz'))+'Transform'] = 'matrix(1,'+(mod * (side == 'right' ? -0.2 : 0.2))+',0,1,0,0) scale('+(1+((1-mod)*0.3)) + ')';
+
+ //
+ if($.browser.msie){
+ css["filter"] = "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=1, M12=0, M21=" + (mod * (side == 'right' ? -0.2 : 0.2)) + ", M22=1";
+ }else{
+ css[($.browser.safari ? 'webkit' : ($.browser.opera ? 'O' : 'Moz'))+'Transform'] = 'matrix(1,'+(mod * (side == 'right' ? -0.2 : 0.2))+',0,1,0,0) scale('+(1+((1-mod)*0.3)) + ')';
+}
+
+ css[self.props[2]] = ( (-i * (self.itemSize/2)) + (side == 'right'? -self.itemSize/2 : self.itemSize/2) * mod );
+
+ if($.browser.msie){
+
+ if(i == self.current){
+ css.width = self.itemWidth * (1+((1-mod)*0.3));
+ css.height = css.width * (self.itemHeight / self.itemWidth);
+ css.top = -((css.height - self.itemHeight) / 3);
+
+ css.left -= self.itemWidth/6 -50;
+ }
+ else{
+ css.width = self.itemWidth;
+ css.height = self.itemHeight;
+ css.top = 0;
+
+ if(side == "left")
+ css.left -= self.itemWidth/5 -50;
+ }//end if
+
+ }//end i
+
+
$(this).css(css);

0 comments on commit e151f83

Please sign in to comment.