scribd是如何实现他们的“全屏”模式的? [英] How did scribd implement their 'fullscreen' mode?

查看:159
本文介绍了scribd是如何实现他们的“全屏”模式的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

scribd全屏模式非常整洁(例如: http://www.scribd.com/doc/13161906/Java-Lab-Manual-With-Java-Installation-Guide?classic_ui=1 )。 (对于RIA来说)的好处是,它不会(几乎)完全禁用键盘,就像Flash Player中的默认全屏模式一样。嵌入时似乎也工作。

他们是怎么做到的?

解决方案

这个例子根本不使用全屏。他们认为全屏只是最大限度地使Flash窗口占据整个浏览器区域。浏览器的工具栏,状态栏和chrome仍然可见,以及浏览器外的任何东西。



这对嵌入HTML页面的Flash / Flex小部件,但与全屏不同。



实现主要在JavaScript / DOM一侧,并且只在Flash / Flex中最小化。当用户点击全屏时,使用ExternalInterface调用JavaScript函数。这个JS函数然后需要重新定位并调整Flash元素的大小,使其位于(0,0)并占据整个屏幕。如果HTML比一个页面长,那么你也需要隐藏它,使浏览器的滚动条消失,就像scribd的例子一样。 Flex / Flash应用程序中的另一个按钮提供了一个关闭或相关按钮来反转进程。

作为Flex开发人员,我反对使用术语全屏这个。全屏是许多Flash / Flex应用程序的常见功能,特别是视频播放器。用户使用这个术语意味着不同的东西让人感到困惑。 最大化比全屏更适合。

The scribd fullscreen mode is pretty neat (example: http://www.scribd.com/doc/13161906/Java-Lab-Manual-With-Java-Installation-Guide?classic_ui=1). The advantage (for RIAs specifically) is that it doesn't (almost) completely disable the keyboard the way the 'default' fullscreen mode in Flash Player does. Seems to also work when embedded.

How did they do it?

解决方案

That example is not using full screen at all. What they consider "full screen" is simply maximizing the flash window to take up the entire browser area. The browser's toolbars and status bar and chrome are still visible, as well as anything outside the browser.

It's a nice effect for a Flash/Flex widget embedded in an HTML page, but it's not the same as full screen.

Implementation is mostly on the JavaScript/DOM side and only minimally within Flash/Flex. When the user clicks "Full Screen", use ExternalInterface to call out to a JavaScript function. This JS function then needs to reposition and resize the Flash element so that it is at (0,0) and takes up the entire screen. If the HTML is longer than a page, then you also need to hide that to make the browser's scrollbar go away, like the scribd example does. Another button inside the Flex/Flash app provides a close or related button to reverse the process.

As a Flex developer, I object to using the term "Full Screen" for this. Full Screen is a common function of many Flash/Flex apps, particularly video players. It's confusing to users to use the term to mean something different. "Maximize" would be more appropriate than "Full Screen".

这篇关于scribd是如何实现他们的“全屏”模式的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆