简体   繁体   English

一种在网页之间进行“类似于iPhone”的转换的方法,但是却浪费了完整(移动)网络框架的开销,并使用了iScroll(v4)

[英]A way to do “iPhone-like” transitions between webpages, but whitout the overhead of a full (mobile)web framework and with the use of iScroll (v4)

I am looking for a simple way to use transitions you typically see in the native iPhone apps or Android native apps (such as the slider effect, ie. the whole page sliding to the left or the right). 我正在寻找一种简单的方法来使用您通常在本机iPhone应用程序或Android本机应用程序中看到的过渡效果(例如滑块效果,即整个页面向左或向右滑动)。

I know those transistions between web pages on my web application are doable with the use of frameworks such as jQuery Mobile, Wink, iUi etc. 我知道Web应用程序上的网页之间的过渡可以通过使用jQuery Mobile,Wink,iUi等框架来实现。

Also my application requires a fixed footer and a fixed header with scrollable content. 我的应用程序还需要一个固定的页脚和一个带有可滚动内容的固定页眉。 I tried with jQuery Mobile but though the scrolling effect of the content is good, the rendering of the fixed header and footers are not that good. 我尝试使用jQuery Mobile,但是尽管内容的滚动效果很好,但是固定的页眉和页脚的呈现效果却不是那么好。

So I use iScroll 4 instead but I cant use jQuery mobile to do only transistions as the jQuery mobile plays with the DOM etc. which causes some problems within the placement of the divs 因此,我改用iScroll 4,但由于jQuery mobile与DOM等一起玩,所以我不能使用jQuery mobile进行跨段操作,这会导致div放置内的某些问题

Im giving a try with iUI but then again though it seems less 'wide' than jQ mobile, it still is a whole framework for web apps. 我尝试使用iUI,但是尽管它似乎没有jQ mobile宽,但它仍然是Web应用程序的完整框架。 But Im currently only looking for transitions.. 但是我目前只在寻找过渡。

Is there a way to achieve those "full web page" transisitons whitout the use of a javascript framework? 有没有一种方法可以在不使用JavaScript框架的情况下实现“完整网页”的转换? Also those framework such as iUI put all the pages inside one only( jQuery Mobile does not which is great ) separating them inside several divs.. this might be problematic with iScroll i guess? 另外,那些诸如iUI之类的框架将所有页面仅放在一个页面中(jQuery Mobile并不是很好),将它们分隔在多个div中。.我猜这可能与iScroll有问题吗?

The finest would be to be able to do those transitions between separate html pages, but I don't know if it's even possible ( I mean whitout the use of AJAX world techniques) 最好的办法是能够在单独的html页面之间进行这些转换,但是我不知道是否有可能(我的意思是不要使用AJAX世界技术)

I only target modern devices using webkit (Android, iDevices..) 我只使用Webkit定位现代设备(Android,iDevices ..)

Thanks a lot for your help 非常感谢你的帮助

You can have a look at http://maker.github.com/ratchet . 您可以查看http://maker.github.com/ratchet It mimics the iPhone behavior quite closely, including all transitions. 它非常紧密地模仿了iPhone的行为,包括所有过渡。

forget iScroll for mobile applications. 忘记移动应用程序的iScroll。 It works well but not for all webkit devices and you will have issues with a good chunk of Android devices. 它运行良好,但不适用于所有Webkit设备,并且很多Android设备都会出现问题。 If you want something like a native app you need to go for a container model. 如果您想要本机应用程序之类的东西,则需要使用容器模型。 A container model is basically having a header and a footer and a dynamic container in the middle. 容器模型基本上在中间具有页眉和页脚以及动态容器。 This is used by mobile sites like Twitter and Flikr. Twitter和Flikr等移动网站都使用此功能。 The dynamic container you can load either with an iframe or ajax (but personally I would stay away from iframes and mobile anything). 您可以使用iframe或ajax加载的动态容器(但就我个人而言,我将远离iframe并移动任何内容)。 Also before using any frameworks out there consider the benefits vs cost (size, future dependency and scalability, overhead parsing the JS... etc) because mobile is not desktop development and many developers seem to forget that fact. 同样,在使用任何框架之前,请考虑收益与成本(大小,将来的依赖关系和可伸缩性,解析JS的开销等)之间的关系,因为移动设备不是台式机开发,许多开发人员似乎都忘记了这一事实。 I currently work for a major social networking site and we have our own framework with is not a byte more then what we need. 我目前在一家主要的社交网站上工作,我们拥有自己的框架,所需要的只是一点点。 We used JQuery in the past but it turned out to be too much bloatwhere for the webkit devices we serve (size + parse time + dependency.. etc) and we ended up killing it. 过去我们使用过JQuery,但事实证明,对于我们所服务的Webkit设备而言,它实在是太膨胀了(大小+解析时间+依赖关系等),最终被杀死了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM