如何从jquery UI选项卡导航打开包含.html文件的fancybox

如何从jquery UI选项卡导航打开包含.html文件的fancybox,html,fancybox,jquery-ui-tabs,Html,Fancybox,Jquery Ui Tabs,我有一组用于顶部导航的jquery选项卡(选项卡只是文本链接,而不是“图形”选项卡)。单击链接时,我希望打开一个包含外部html文件的fancybox。这并没有发生。没有花式盒子在发射。下面是我的代码。你们能告诉我我做错了什么,以及如何修复吗?我搞不清楚。谢谢 脚本: <link rel="stylesheet" href="../css/jquery.fancybox.css" type="text/css" /> <script language="javascript"

我有一组用于顶部导航的jquery选项卡(选项卡只是文本链接,而不是“图形”选项卡)。单击链接时,我希望打开一个包含外部html文件的fancybox。这并没有发生。没有花式盒子在发射。下面是我的代码。你们能告诉我我做错了什么,以及如何修复吗?我搞不清楚。谢谢

脚本

<link rel="stylesheet" href="../css/jquery.fancybox.css" type="text/css"  />
<script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script language="javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script language="javascript" src="../js/fancybox/jquery.fancybox.js"></script>

HTML:


$(文档).ready(函数(){
$(“#课程选项卡”).tabs();
$(“.tabs内容”).fancybox({
'type':'iframe',
“最大宽度”:580,
“最大高度”:390,
“fitToView”:错误,
“宽度”:500,
‘高度’:300,
“自动调整大小”:false
});
});
fancybox的课程/addition1.html代码:

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Just try it!</title>
<style>
div {font-family:Arial, Helvetica, sans-serif;font-size:16px;}
.blkstyle {display:block;}
input[type=submit] {margin-top:10px;}
</style>
</head>

<body>
<div>
<p>If you have 14 apples, Justin has 12 and Mary gives you 7 more apples, but only gives Justin 3 apples, how many apples would you and Justin have altogether?</p>
<form>
<span class="blkstyle"><input type="radio" name="apples" /><label>24</label></span>
<span class="blkstyle"><input type="radio" name="apples" /><label>42</label></span>
<span class="blkstyle"><input type="radio" name="apples" /><label>36</label></span>
<span class="blkstyle"><input type="radio" name="apples" /><label>16</label></span>
<input type="submit" value="Answer" />
</form>

</div>
</body>
</html>
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Just try it!</title>
    <style>
    div {font-family:Arial, Helvetica, sans-serif;font-size:16px;}
    .blkstyle {display:block;}
    input[type=submit] {margin-top:10px;}
    </style>
    </head>

    <body>
    <div>
        <p>Jamie has 38 lives left in play for his new video game.  
        He loses 6 lives on level Nine and 5 lives on level Twelve.  
        He hasn't gained anymore lives until level Twenty, where he gets 4 more, 
        but loses 1 life in play.  How many lives does Jamie have left in play?</p>
        <form>
            <span class="blkstyle"><input type="radio" name="apples"  /><label >26</label></span>
            <span class="blkstyle"><input type="radio" name="apples" /><label>30</label></span>
            <span class="blkstyle"><input type="radio" name="apples" /><label>22</label></span>
            <span class="blkstyle"><input type="radio" name="apples" /><label>16</label></span>
            <input type="submit" value="Answer" class="blkstyle"/>
        </form>

    </div>
</body>
</html>

试试看!
div{字体系列:Arial,Helvetica,无衬线;字体大小:16px;}
.blkstyle{display:block;}
输入[type=submit]{页边距顶端:10px;}
如果你有14个苹果,贾斯汀有12个,玛丽再给你7个,但只给贾斯汀3个,你和贾斯汀总共有多少个

24 42 36 16
fancybox的lessons/Desculation 1.html代码:

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Just try it!</title>
<style>
div {font-family:Arial, Helvetica, sans-serif;font-size:16px;}
.blkstyle {display:block;}
input[type=submit] {margin-top:10px;}
</style>
</head>

<body>
<div>
<p>If you have 14 apples, Justin has 12 and Mary gives you 7 more apples, but only gives Justin 3 apples, how many apples would you and Justin have altogether?</p>
<form>
<span class="blkstyle"><input type="radio" name="apples" /><label>24</label></span>
<span class="blkstyle"><input type="radio" name="apples" /><label>42</label></span>
<span class="blkstyle"><input type="radio" name="apples" /><label>36</label></span>
<span class="blkstyle"><input type="radio" name="apples" /><label>16</label></span>
<input type="submit" value="Answer" />
</form>

</div>
</body>
</html>
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Just try it!</title>
    <style>
    div {font-family:Arial, Helvetica, sans-serif;font-size:16px;}
    .blkstyle {display:block;}
    input[type=submit] {margin-top:10px;}
    </style>
    </head>

    <body>
    <div>
        <p>Jamie has 38 lives left in play for his new video game.  
        He loses 6 lives on level Nine and 5 lives on level Twelve.  
        He hasn't gained anymore lives until level Twenty, where he gets 4 more, 
        but loses 1 life in play.  How many lives does Jamie have left in play?</p>
        <form>
            <span class="blkstyle"><input type="radio" name="apples"  /><label >26</label></span>
            <span class="blkstyle"><input type="radio" name="apples" /><label>30</label></span>
            <span class="blkstyle"><input type="radio" name="apples" /><label>22</label></span>
            <span class="blkstyle"><input type="radio" name="apples" /><label>16</label></span>
            <input type="submit" value="Answer" class="blkstyle"/>
        </form>

    </div>
</body>
</html>

试试看!
div{字体系列:Arial,Helvetica,无衬线;字体大小:16px;}
.blkstyle{display:block;}
输入[type=submit]{页边距顶端:10px;}
杰米的新游戏还有38条生命。
他在第九层失去6条生命,在第十二层失去5条生命。
直到20级,他才获得更多的生命,
但在游戏中失去了1条生命。杰米还剩下多少生命

26 30 22 16

您只需要一个fancybox实例(您正在加载普通版本和软件包版本)。。。也许有一个conflict@JFK谢谢我不确定这就是问题所在。我已经删除了脚本。但是,在IE 7/8/9中,会显示addition1.html外部页面,就像默认情况一样。当我单击“添加”链接时,它也会在fancybox中打开,但默认情况下,该外部.html页面不应显示在页面上。你或任何人知道为什么会这样吗?在Chrome和Firefox中,只显示选项卡链接,这是预期的。好吧,您的代码可以在这里看到。。。。当然,fancybox找不到页面,但正在启动。您可能在某个地方出现js错误。顺便说一句,对于v2.x来说,
hideOnContentClick
不是一个有效的API选项。检查一下,我在jquery中添加了一个屏幕截图并删除了
hideOnContentClick
选项——这是我使用的唯一javascript/jquery,而不是jquery选项卡脚本,我没有以任何方式修改代码。我使用的文件是针对html5的doctype html。我不知道为什么在IE中我看到addition1.html页面的内容是默认的。我检查了你的小提琴并在IE中运行了它,你是对的,内容不在页面上,但正如你所看到的,它在我的页面上。我在浏览器中也删除了缓存(链接为蓝色,未访问-刷新页面),但我仍能看到内容。您能否共享一个链接或创建一个复制该问题的示例?否则我们可以继续猜测