                 return
             }
             
-            if let p = percentage {
-                var finalY = tableView.contentSize.height * percentage!
-                
-                if (finalY < 0) {
-                    finalY = 0
-                } else if(finalY > tableView.contentSize.height - scrollCountViewHeight) {
-                    finalY = tableView.contentSize.height - scrollCountViewHeight
-                }
-                topConstraint.constant = finalY
+            let oneDistance = tableView.bounds.size.height / CGFloat(totalScrollCountNum)
+            let currentCellHeight = currentCellRectu.size.height
+            let currentCellOffset = currentCellRectu.origin.y
+            let currentOffset = tableView.contentOffset.y
+            
+            let dxp = (currentOffset - currentCellOffset)/currentCellHeight
+            let dx = dxp * oneDistance
+            
+            var finalY = tableView.contentOffset.y + ((tableView.bounds.size.height*CGFloat(scrollCountView.currentScrollCountNum)) / CGFloat(totalScrollCountNum)) + dx
+            
+            if (finalY < 0) {
+                finalY = 0
+            } else if(finalY > tableView.contentSize.height - scrollCountViewHeight) {
+                finalY = tableView.contentSize.height - scrollCountViewHeight
             }
+            
+            topConstraint.constant = finalY
         }
     }
+    
 }

    private var dynamicUnpagedHeight:Bool = false
    var y:CGFloat = -1000
    private var topConstraint : NSLayoutConstraint!
    var rectHeight:CGFloat?
    
    public var opacity:CGFloat = 1 {
        didSet {

    
    func updateScrollPosition() {
        
        //var currentCellRect:CGRect?
        let indexPaths = tableView.indexPathsForVisibleRows
        var currentCellRect:CGRect?
        if let indexPaths = indexPaths {
            if indexPaths.count > 0 {
                currentCellRect = tableView.rectForRowAtIndexPath(indexPaths[0])
                scrollCountView.currentScrollCountNum = indexPaths[0].row
            }
        }
        
        
        guard let currentCellRectu = currentCellRect else {
            return
