Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleaning comments, removing unneeded spacing

  • Loading branch information...
commit 92f040b0eb243139965b1182ade077421e1566d8 1 parent d0a2b29
@addyosmani addyosmani authored
Showing with 9 additions and 26 deletions.
  1. +9 −26 ui.coverflow.js
View
35 ui.coverflow.js
@@ -1,8 +1,7 @@
/*
* jQuery UI CoverFlow
- Original Component: Paul Bakaus
- Minor changes to appear more 'coverflow-like' in cooperation
- with front-end UI extension in app.js - Addy Osmani.
+ Re-written for jQueryUI 1.8.6 by Addy Osmani with adjustments
+ Original Component: Paul Bakaus for jQueryUI 1.7 series
*/
(function($){
@@ -23,8 +22,8 @@
orientation: 'horizontal',
item: 0,
trigger: 'click',
- center: true, //If set to false, the actual element's base position isn't touched in any way
- recenter: true //If set to false, the parent element's position doesn't get animated while items change
+ center: true, //If false, element's base position isn't touched in any way
+ recenter: true //If false, the parent element's position doesn't get animated while items change
},
@@ -33,24 +32,17 @@
var self = this, o = this.options;
this.items = $(o.items, this.element);
this.props = o.orientation == 'vertical' ? ['height', 'Height', 'top', 'Top'] : ['width', 'Width', 'left', 'Left'];
- //this.itemSize = this.items.innerWidth(); //190, //1.8.6: this.items['outer'+this.props[1]](1);
+ //For < 1.8.2: this.items['outer'+this.props[1]](1);
-
this.itemSize = 0.73 * this.items.innerWidth();
-
- console.log(this.items.innerHeight());
- console.log(this.items.outerHeight());
this.itemWidth = this.items.width();
this.itemHeight = this.items.height();
this.duration = o.duration;
- this.current = o.item; //Start item
-
-
-
-
+ this.current = o.item; //initial item
+
//Bind click events on individual items
this.items.bind(o.trigger, function() {
self.select(this);
@@ -59,10 +51,7 @@
//Center the actual parent's left side within it's parent
-
-
-
-
+
this.element.css(this.props[2],
(o.recenter ? -this.current * this.itemSize/2 : 0)
+ (o.center ? this.element.parent()[0]['offset'+this.props[1]]/2 - this.itemSize/2 : 0) //Center the items container
@@ -94,8 +83,7 @@
// 2. Animate the parent's left/top property so the current item is in the center
// 3. Use our custom coverflow animation which animates the item
-
-
+
var animation = { coverflow: 1 };
@@ -107,10 +95,6 @@
);
-
-
-
-
//Trigger the 'select' event/callback
if(!noPropagation) this._trigger('select', null, this._uiHash());
@@ -156,7 +140,6 @@
-
$(this).css(css);
Please sign in to comment.
Something went wrong with that request. Please try again.