简体   繁体   English

如何使用cache.manifest使ChillBox(LightBox克隆)在脱机Web应用程序上工作?

[英]How Can I get ChillBox (a LightBox clone) to work on an offline webapp using cache.manifest?

I am building a web app for an iPad (designed so my boss can show information at meetings). 我正在为iPad构建一个Web应用程序(设计该应用程序的目的是让老板可以在会议上显示信息)。 So far I have everything working, except for one thing- I am using an application cache to allow the app to work offline (cache.manifest), and for some reason, when I go offline, I can not get any sort of lightbox type script to work. 到目前为止,除了一件事之外,我一切正常,我正在使用应用程序缓存来允许应用程序脱机工作(cache.manifest),由于某种原因,当我脱机时,我无法获得任何类型的灯箱类型脚本工作。
When I am connected to the internet everything functions as desired, but as soon as I disconnect the images open on a new page in Safari instead of showing in a lightbox. 当我连接到Internet时,所有功能都会按预期运行,但是一旦断开连接,图像就会在Safari的新页面上打开,而不是显示在灯箱中。
Currently I am using ChillBox ( http://www.chillwebdesigns.co.uk/chillbox ), but I have also used SlimBox and it had the same problem. 目前,我正在使用ChillBox( http://www.chillwebdesigns.co.uk/chillbox ),但是我也使用了SlimBox,它也有同样的问题。 (I tried LightBox 2, but it failed for other reasons.) (我尝试了LightBox 2,但由于其他原因失败了。)

I have all the images in my manifest, as well as all the .js files. 我的清单中有所有图像,以及所有.js文件。 The links are all formatted as such: 链接的格式均如下:

<a href="path/to/image.gif" rel="ChillBox" title="A title" class="lb">
    <img src="path/to/image.gif" alt="" />
</a>

Anyone have any ideas? 有人有想法么?

Problem appears to be solved. 问题似乎已解决。 I was loading the chillbox.js inline after the set of links that it applied to. 我在将chillbox.js应用于一组链接之后内联加载。 This worked online, but failed offline. 此操作在线运行,但脱机失败。 Putting the link to the js in the head of the parent file seems to have fixed this for now! 现在将指向js的链接放在父文件的开头似乎已经解决了该问题!

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

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