     }
     
     func scrollToIndex(targetIndex: Int) {
+        // 小动画
+        setAnimation()
+        collectionView?.layer.add(animation, forKey: nil)
+        
         if targetIndex >= totalItemsCount {
             if infiniteLoop {
                 let index = targetIndex % totalItemsCount

            }else{
                targetIndex = 0;
            }
            collectionView?.scrollToItem(at: NSIndexPath(item: targetIndex, section: 0) as IndexPath, at: .right, animated: false)
        }
    }

    var pageDotColor: UIColor = UIColor.lightGray // 其他分页控件小圆标颜色
    //    var currentPageDotImage: UIImageView // 当前分页控件小圆标图片
    //    var pageDotImage: UIImageView // 其他分页控件小圆标图片
    var animation = CATransition()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
