             let next = Int(floor(page))
             if next != selectedIndex {
                 selectedIndex = next
-                UIView.animateWithDuration(0.3, animations: layoutTabIndicator)
+                UIView.animateWithDuration(0.3, animations:layoutTabIndicator)
             }
             
             var ignored : Double = 0.0
             page = scrollView.contentOffset.x / pageWidth;// Current page index with fractions
             let index = Int(page)
-            if index + 1 < viewControllerCount {
+            if index + 1 < viewControllerCount && enableParallex {
                 // We are using the difference from one label to the other to implement varying speeds
-                // so every title is exactly centered if you are on a page
+                // for our custom parallax effect, so every title is exactly centered if you are on a page
                 let diff = tabLabels[index+1].frame.origin.x - tabLabels[index].frame.origin.x
-                let centering1 = (titleScrollView.frame.size.width - tabLabels[index].frame.size.width)/2
-                let centering2 = (titleScrollView.frame.size.width - tabLabels[index+1].frame.size.width)/2
+                let centering1 = (titleScrollView.bounds.size.width - tabLabels[index].frame.size.width)/2
+                let centering2 = (titleScrollView.bounds.size.width - tabLabels[index+1].frame.size.width)/2
                 let frac = CGFloat(modf(Double(page), &ignored))// Only fraction part remains, Eg 3.4344 -> 0.4344
                 let newXOff = tabLabels[index].frame.origin.x + diff * frac - centering1 * (1-frac) - centering2 * frac;
                 titleScrollView.contentOffset = CGPointMake(fmax(0, newXOff), 0)
             }
         }
     }
+    
+    public func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
+        enableParallex = true // Always enable after an animation
+    }
 }
        titleScrollView.addSubview(tabIndicator)
        
        contentScrollView = UIScrollView(frame: CGRectZero)
        contentScrollView.autoresizingMask = .FlexibleWidth | .FlexibleBottomMargin
        contentScrollView.backgroundColor = UIColor.whiteColor()
        contentScrollView.delaysContentTouches = false
        contentScrollView.showsHorizontalScrollIndicator = false
        contentScrollView.pagingEnabled = true
        contentScrollView.delegate = self
        contentScrollView.setTranslatesAutoresizingMaskIntoConstraints(false)
        self.view.addSubview(contentScrollView)
    }
    

    private var tabLabels = [UIButton]()
    private var bottomLine, tabIndicator : UIView!
    private var selectedIndex : Int = 0
    private var enableParallex = true
    
    public var selectedViewController : UIViewController {
        get {
