         let tap:UIGestureRecognizer = sender as! UIGestureRecognizer
         let tab:WormTabStripButton = tap.view as! WormTabStripButton
         
+        prevTabIndex = currentTabIndex
         currentTabIndex = tab.index!
+        setTabStyle()
+        
         natruallySlideWormToPosition(tab: tab)
         natruallySlideContentScrollViewToPosition(index: tab.index!)
         adjustTopScrollViewsContentOffsetX(tab: tab)

        
    }
    
    func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
        let currentX = scrollView.contentOffset.x
        currentTabIndex = Int(currentX/Width)
        let tab = tabs[currentTabIndex]
        
        adjustTopScrollViewsContentOffsetX(tab: tab)
        UIView.animate(withDuration: 0.23) {

        Width = self.frame.width
        Height = self.frame.height
    }
    convenience required public init(key:String) {
        self.init(frame:CGRect.zero)
    }
    
    required public init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
        
    }
