ScrollLayer
http://www.oschina.net/p/scrolllayer
编辑/纠错
ScrollLayer 是一个用于 cocos2d-iphone 应用上的屏幕滚动组件。

兼容性:
兼容iOS(Mobile Safari)/Android(Webkit)/PC(IE除外),其它未考证
操作方法:
在所支持的Touch设备上,用手指按住图片区域,然后向右(或向下)华丽丽地一拖,随即松开手指。Yeah~
调用语法示例:
$('#J_Gallery').scrollLayer({
direction:'X', //方向。X代表水平方向,Y代表垂直方向
wrapEl:'.wrap', //外层容器。用来overflow遮罩的层
touchEl:'.holder', //touch层容器。用来包裹列表内层元素的层
childEl:'li', //内层元素。用来放图的层
margin:5, //间距。以实际元素间距为准
speed:0.95, //加速度。一般取0.9-1之间
prevent:true //阻止超链接默认事件
});
已知问题&待改进:
- 个别低配置Android设备上(HTC HERO G3)响应有些迟滞。
- 暂没有开发图片自动对准功能。
- 授权协议: MIT
- 开发语言: Objective-C
- 操作系统: iPhone/iPad/iPod
- 收录时间: 鉴客 -> 2010年07月19日
![]() |
ScrollLayer 的 demo的连接貌似有问题,是个色情网站。。...铂金小猪 发表于3年前 ,最后回答(3年前):红薯» |
|
| demo | 2 spaces to 4 spaces; sorry for the BS commit | 3 years ago | |
| doc | Update diagram to include contentOffset | 4 years ago | |
| src | 2 spaces to 4 spaces; sorry for the BS commit | 3 years ago | |
| .gitattributes | Fix demo bug | 4 years ago | |
| .gitignore | initial commit | 4 years ago | |
| README.md | Update README | 3 years ago |
README.md
ScrollLayer
A scrollable layer for cocos2d-iphone apps.
This is very simple and does not do much. I recommend you usehttps://github.com/cocos2d/cocos2d-iphone-extensions/tree/master/Extensions/CCScrollLayerinstead for real work.
Features
- scrolling in 2D;
- velocity ("inertial scrolling");
- clipping (your layer doesn't have to use the entire window bounds).
Compatibility
Developed against cocos2d-iphone v1.0.0rc3.
History
There is a chaotic thread about a scrolling layer implementation for cocos2d-iphone apps. There's a ton of patches and bug reports. I gave up trying to follow that thread and decided to code my own version.
Future
I plan on creating a simple UITableView-like layer based on this code.
Concepts

Author
Brian Hammond brian@fictorial.com (http://fictorial.com)
License
Copyright (c) 2011 Fictorial LLC.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
https://github.com/igorkotkovets/ios-cocos2d-scroll
| src | Cocos2d scroll updated | 2 years ago |
ScrollLayer的更多相关文章
- [翻译] JTNumberScrollAnimatedView
JTNumberScrollAnimatedView 本人视频教程系类 iOS中CALayer的使用 效果: Use JTNumberScrollAnimatedView for have a n ...
- iOS核心动画高级技巧之图层变换和专用图层(二)
iOS核心动画高级技巧之CALayer(一) iOS核心动画高级技巧之图层变换和专用图层(二)iOS核心动画高级技巧之核心动画(三)iOS核心动画高级技巧之性能(四)iOS核心动画高级技巧之动画总结( ...
- cocos2dx基础篇(14) 滚动视图CCScrollView
[3.x] (1)去掉 "CC" (2)滚动方向 > CCScrollViewDirection 改为强枚举 ScrollView::Dire ...
- iOS之CAScrollLayer属性简介和使用
1.CAScrollLayer的简介 CAScrollLayer用于显示一个滑动图层的一部分,可以确定滑动方向和可视区域面积,限制不滑出区域外!相关属性如下:其中 /* Scroll the cont ...
随机推荐
- Jongmah CodeForces - 1110D
传送门 题意:你有n个数字,范围[1, m],你可以选择其中的三个数字构成一个三元组,但是这三个数字必须是连续的或者相同的,每个数字只能用一次,问这n个数字最多构成多少个三元组? 题解:三个一模一样的 ...
- 模块hashlib和logging
Python的hashlib提供了常见的摘要算法MD5. 我们以常见的摘要算法MD5为例,计算出一个字符串的MD5值: import hashlib md5=hashlib.md5() md5.upd ...
- python模块struct和subprocess
准确地讲,Python没有专门处理字节的数据类型.但由于str既是字符串,又可以表示字节,所以,字节数组=str.而在C语言中,我们可以很方便地用struct.union来处理字节,以及字节和int, ...
- C语言关键词解释
51单片机关键词 code code的作用是告诉单片机,我定义的数据要放在ROM(程序存储区)里面,写入后就不能再更改
- Struts2---配置文件讲解及简单登录示例
bean 用于创建一个JavaBean实例 constant 用于Struts2默认行为标签 <!-- 配置web默认编码集,相当于HttpServletRequest.setChartacte ...
- 树莓派Raspberry Pi 3安装步骤
一.需要的硬件 1.Raspberry Pi 3(Model B+)树莓派.购买>https://item.jd.com/29225467867.html 2.输出5V/2A的电源 3.SD卡( ...
- 《Cracking the Coding Interview》——第6章:智力题——题目3
2014-03-20 00:48 题目:有3升的瓶子和5升的瓶子,只允许倒满.倒到满为止.或是泼光三种操作,怎么搞出4升水呢? 解法:如果A和B是互质的两个正整数,且A<B,令X=B-A,则(X ...
- shell脚本获取网页快照并生成缩略图
获取网页快照并生成缩略图可分两步进行: 1.获取网页快照 2.生成缩略图 获取网页快照 这里我们用 phantomjs 来实现.关于 phantomjs 的详细用法可参考官方网站. 1.安装 我的环境 ...
- Python 3基础教程7-if语句
前面文章介绍的循环语句,这里开始介绍控制语句.直接看下面的demo.py例子 # 这里介绍 if语句 x = 5y = 8z = 4s = 5 if x < y: print('x is les ...
- dinic 算法 基本思想及其模板
“网络流博大精深”—sideman语 一个基本的网络流问题 感谢WHD的大力支持 最早知道网络流的内容便是最大流问题,最大流问题很好理解: 解释一定要通俗! 如右图所示,有一个管道系统,节点{1,2, ...

