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

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

问题描述

scribd 全屏模式非常简洁(例如:http://www.scribd.com/doc/13161906/Java-Lab-Manual-With-Java-Installation-Guide?classic_ui=1).优点(特别是对于 RIA)是它不会(几乎)像 Flash Player 中的默认"全屏模式那样完全禁用键盘.嵌入时似乎也有效.

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.

他们是怎么做到的?

推荐答案

那个例子根本没有使用全屏.他们认为全屏"只是最大化 Flash 窗口以占据整个浏览器区域.浏览器的工具栏、状态栏和 chrome 以及浏览器之外的任何内容仍然可见.

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.

对于嵌入在 HTML 页面中的 Flash/Flex 小部件来说,这是一个不错的效果,但与全屏不同.

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

实现主要在 JavaScript/DOM 端,仅在 Flash/Flex 中实现.当用户单击全屏"时,使用 ExternalInterface 调用 JavaScript 函数.这个 JS 函数然后需要重新定位和调整 Flash 元素的大小,使其位于 (0,0) 并占据整个屏幕.如果 HTML 比页面长,那么您还需要隐藏它以使浏览器的滚动条消失,就像 scribd 示例所做的那样.Flex/Flash 应用程序中的另一个按钮提供了一个关闭或相关按钮来反转该过程.

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.

作为 Flex 开发人员,我反对为此使用术语全屏".全屏是许多 Flash/Flex 应用程序的常见功能,尤其是视频播放器.用户使用该术语来表示不同的意思会让人感到困惑.最大化"比全屏"更合适.

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天全站免登陆