在移动Safari中创建这种效果?
我想在移动游猎中创建这种效果。 http://jqueryfordesigners.com/demo/header-slide.html
我正在使用iScroll 4。我想将 iScroll 与此示例混合。
http://jsfiddle.net/tdQmQ/3/ (这是我到目前为止所拥有的,使用鼠标像触摸事件一样轻拂)
标题不应该位于滚动区域吗?如果有人能指出我正确的方向,那就太好了。
最大的问题是锁定 iScroll 的滚动事件,我不知道如何。
谢谢
编辑:我终于构建了我想要的东西, http://jsfiddle.net/tdQmQ/25 - 仍然需要修复 z-index,以便标题显示在克隆框上方。
EDIT2:实际上我最终更改了库以公开其 x 和 y 位置,而不是对 dom 元素进行间隔轮询。如果您不介意破解该库,效果会更好。
I want to create this effect in mobile safari. http://jqueryfordesigners.com/demo/header-slide.html
I'm using iScroll 4. I want to mix iScroll with this example.
http://jsfiddle.net/tdQmQ/3/ (here is what i have so far, use the mouse to flick like a touch event)
Should headers not be in the scroll area? If any one can point me in the right direction that would be great.
The biggest problem is latching onto scroll events of iScroll, i dont know how.
Thanks
EDIT: I finally built what I was looking for, http://jsfiddle.net/tdQmQ/25 - still need to fix the z-index so headers show above the clone box though.
EDIT2: I actually ended up changing the library to expose its x and y positions, instead of doing the interval polling on the dom element. Works much better if you don't mind hacking the lib.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
繁荣:http://jsfiddle.net/jasper/tdQmQ/11/ (更新为包括 touchend 事件以及 mouseup)
JS--
HTML--
CSS--
setTimeout
存在,因此滚动可以在滚动结束位置的值之前发生可用。vender
prefix
变量是从 iScroll 应用的第一个样式中提取的。Boom: http://jsfiddle.net/jasper/tdQmQ/11/ (Updated to include the touchend event as well as mouseup)
JS--
HTML--
CSS--
The
setTimeout
is there so the scroll can occur before values for where the scroll ends will be available.The vender
prefix
variable is pulled from the first style applied by iScroll.我终于构建了我想要的东西, http://jsfiddle.net/tdQmQ/25 - 仍然需要修复 z-index,以便标题显示在克隆框上方。
I finally built what I was looking for, http://jsfiddle.net/tdQmQ/25 - still need to fix the z-index so headers show above the clone box though.