admin管理员组文章数量:1327849
I'm trying to load an iFrame in to colorbox using an onload event - seems like it should be simple but I'm getting the error "the content failed to load"
Here's my code:
<script type="text/javascript">
$(document).ready(function(){
$.colorbox({href:"", open: true});
});
</script>
Any ideas as to why this may not be working?
I'm trying to load an iFrame in to colorbox using an onload event - seems like it should be simple but I'm getting the error "the content failed to load"
Here's my code:
<script type="text/javascript">
$(document).ready(function(){
$.colorbox({href:"http://www.google.", open: true});
});
</script>
Any ideas as to why this may not be working?
Share Improve this question asked May 11, 2012 at 9:56 user319940user319940 3,3178 gold badges40 silver badges54 bronze badges 4- 1 you try adding iframe: true to the call – gunnx Commented May 11, 2012 at 10:00
- *facepalm" thanks! worked perfectly. Please put it as an answer so I can accept :P. – user319940 Commented May 11, 2012 at 10:03
- colorbox is one of my favourite lightboxes, use it regularly. – gunnx Commented May 11, 2012 at 10:04
- Seems good so far, I'm sure I'll have a few more mishaps but seems like a lot of people use it. – user319940 Commented May 11, 2012 at 10:07
2 Answers
Reset to default 4You need to add iframe: true to the function call
I made this Fiddle to test that issue, and concluded that it has a weird behavior when the width and the height are not set, so this way I did solved the issue:
JQUERY
$(document).ready(function(){
$.colorbox({
iframe : true,
innerWidth : 425,
innerHeight : 344,
href : "http://www.youtube./embed/617ANIA5Rqs?rel=0&wmode=transparent"
});
});
本文标签: javascriptonLoad iFrame with ColorboxStack Overflow
版权声明:本文标题:javascript - onLoad iFrame with Colorbox - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742218991a2435093.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论