简体   繁体   English

iBooks中的Dashcode小部件可使用哪些HTML5功能?

[英]What HTML5 features are available for Dashcode widgets in iBooks?

With the new iBooks Author tool, you can create e-books for the iPad. 使用新的iBooks Author工具,您可以为iPad创建电子书。 The format allows you to embed HTML widgets created with Dashcode. 该格式允许您嵌入使用Dashcode创建的HTML窗口小部件。 The resulting files can be distributed outside of the app store, similar, but probably easier (because it is just one file in a format Apple fully supports), than offline HTML5 web apps (which you have to install via Safari). 生成的文件可以在应用商店外分发,这与脱机HTML5 Web应用程序(您必须通过Safari安装)类似,但可能更容易(因为它只是Apple完全支持的格式的一个文件)。

What features of HTML5 can be used in those Dashcode widgets? 这些Dashcode小部件可以使用HTML5的哪些功能? Is there for example DOM storage? 例如有DOM存储吗? Canvas? 帆布? Location? 地点?

Regarding storage, tests made in preview mode on the iPad suggest that localStorage works. 关于存储,在iPad上以预览模式进行的测试表明localStorage可以工作。 It is per book. 这是每本书。 You can save data in one HTML widget and read them in another HTML widget. 您可以将数据保存在一个HTML小部件中,然后在另一个HTML小部件中读取它们。

Regarding location, this blog post on " Location with iBooks Author " suggests that it is functional 关于位置,有关“ iBooks Author的位置 ”的博客文章建议该功能正常

I just built a test widget that uses flot to draw graphs into a canvas element, and then I inserted the widget into an iBook. 我刚刚构建了一个使用flot将图形绘制到画布元素中的测试小部件,然后将其插入到iBook中。 When previewing the iBook on my iPad 1, the graph doesn't appear in the in-layout thumbnail, but when expanded to full screen, the graph displays beautifully. 在iPad 1上预览iBook时,该图形不会出现在版式缩略图中,但是当展开到全屏显示时,该图形将显示精美。

So as far as canvas is concerned: it appears to be available, but apparently only when in full-screen interactive mode. 因此,就画布而言:它似乎可用,但显然仅在全屏交互模式下才可用。

Update : Apparently the in-layout thumbnail is just an image of the widget, not the widget itself, which is why the graph (which requires executing code) does not display. 更新 :显然,布局缩略图只是小部件的图像,而不是小部件本身,这就是为什么图形(需要执行代码)不显示的原因。

CSS Animations can be inserted into iBooks via the iBooks author widget support. 可以通过iBooks作者小部件支持将CSS动画插入iBooks。 Here is an example of us using Sencha Animator to add animations to iBooks Author. 这是一个使用Sencha Animator 向iBooks Author添加动画的示例

一个github存储库,其中包含一些演示HTML小部件 ,这些小部件显示了如何使用交互式功能。

I didn't get Canvas Code to execute on an iPad 1. 我没有在iPad 1上执行Canvas代码。

Update: no success on iPad 2 either. 更新:在iPad 2上也没有成功。

(Edit: I was using the Processing.js library) (编辑:我正在使用Processing.js库)

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

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