The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity | |
{ | |
// We're going to center the centermost item... | |
// Use the bounds to have the snap happen the minute drag stops. In other words use the current content offset (which = bounds.origin) instead of the proposed end offset (which takes velocity into account) | |
CGRect proposedRect = self.collectionView.bounds; | |
CGFloat proposedContentOffsetCenterX = proposedContentOffset.x + self.collectionView.bounds.size.width * 0.5f; | |
// Comment out if you want the collectionview simply stop at the center of an item while scrolling freely (ie take velocity into account) |
<?php | |
/* | |
PHP CSS Browser Selector v0.0.2 (Update by Hari Karam Singh) | |
Bastian Allgeier (http://bastian-allgeier.de) | |
http://bastian-allgeier.de/css_browser_selector | |
License: http://creativecommons.org/licenses/by/2.5/ | |
Credits: This is a php port from Rafael Lima's original Javascript CSS Browser Selector: http://rafael.adm.br/css_browser_selector | |
*/ |
<?php | |
/* | |
PHP CSS Browser Selector v0.0.1 | |
Bastian Allgeier (http://bastian-allgeier.de) | |
http://bastian-allgeier.de/css_browser_selector | |
License: http://creativecommons.org/licenses/by/2.5/ | |
Credits: This is a php port from Rafael Lima's original Javascript CSS Browser Selector: http://rafael.adm.br/css_browser_selector | |
*/ |