简体   繁体   English

Fancybox不会加载内联内容

[英]Fancybox won't load inline content

To make things easy, here's the site - http://schnell.dreamhosters.com/folio/pixelread.php View the source code all you like. 为了方便起见,这里是网站 - http://schnell.dreamhosters.com/folio/pixelread.php查看您喜欢的源代码。

The middle button of the top bar in your browser window that says "Palette" is supposed to open up a fancybox in the middle of the screen, and that box should load into it the data inside the element with id of 'data', but it doesn't and comes up with an error message of "The requested content cannot be loaded. Please try again later." 浏览器窗口顶部栏的中间按钮显示“Palette”应该在屏幕中间打开一个fancybox,该框应该加载id为'data'的元素内的数据,但是它没有,并提出错误消息“无法加载请求的内容。请稍后再试。” I took this example straight from the fancybox website and double-checked that all the CSS, image and JS files are in their proper place and loaded. 我直接从fancybox网站上看了这个例子,并仔细检查了所有的CSS,图像和JS文件是否在适当的位置并加载。 So now I'm lost and no idea how to do/fix this. 所以现在我迷路了,不知道如何做/解决这个问题。

PS - I use Google Chrome 6.0. PS - 我使用谷歌Chrome 6.0。 I'll see if this happens in IE8 or Firefox. 我会看看这是否发生在IE8或Firefox中。

PPS - Found a solution. PPS - 找到了解决方案。 I can force the HTML content that goes into a fancybox by using the 'content' property. 我可以使用'content'属性强制进入fancybox的HTML内容。 Using that and jQuery I can easily stuff a box with whatever I want. 使用它和jQuery我可以轻松地填充任何我想要的盒子。 Thanks for the help guys. 谢谢你的帮助。

Found a solution. 找到了解决方案。 I can force the HTML content that goes into a fancybox by using the 'content' property. 我可以使用'content'属性强制进入fancybox的HTML内容。 Using that and jQuery I can easily stuff a box with whatever I want. 使用它和jQuery我可以轻松地填充任何我想要的盒子。 Thanks for the help guys. 谢谢你的帮助。

I think the problem is that fancybox isn't recognizing your content as being inline (not exactly sure why, but maybe something to do with the query string in the url, since it works when that isn't present). 我认为问题是fancybox没有将你的内容识别为内联(不完全确定原因,但可能与url中的查询字符串有关,因为它在不存在时有效)。

I would try adding the explicit type: inline to your fancybox declaration: 我会尝试添加显式type: inline到您的fancybox声明:

$("a#inline").fancybox({'type':'inline'}); 

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

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