我正在尝试使用灯箱打开表单,表单本身是在另一个页面中使用的 html。
问题是我尝试了ShadowBox,它打开了一个 iframe,我的大部分变量都在这个过程中丢失了。我试过Lightbox5
了,我似乎无法找到传递 html 的代码。
有什么建议么?
我用 ShadowBox 做了这样的事情
<a rel="shadowbox[MyStuff]" href="survey.html">survey</a>
它会解析传入的元素是 html,但它会在 iframe 中打开,从而丢失我在此页面中的变量
添加了整个示例代码
<html>
<head>
<!-- the shadowbox stylesheet and js -->
<link rel="stylesheet" type="text/css" href="jquery.lightbox-0.5.css"
media="screen" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.lightbox-0.5.js"></script>
<script type="text/javascript">
$(document)
.ready(function ()
{
// Use this example, or...
$('a[@rel*=lightbox]')
.lightBox(); // Select all links that contains lightbox in the attribute rel
// This, or...
$('#gallery a')
.lightBox(); // Select all links in object with gallery ID
$('#somehiddendiv div')
.lightBox(); // Select all links in object with gallery ID
// This, or...
$('a.lightbox')
.lightBox(); // Select all links with lightbox class
// This, or...
$('a')
.lightBox(); // Select all links in the page
// ... The possibility are many. Use your creative or choose one in the examples above
});
$(function ()
{
$.ajax(
{
url: 'survey.html',
dataType: 'html',
success: function (data)
{
$('#somehiddendiv')
.html(data);
}
});
});
</script>
</head>
<body>
<!-- <a href="egypt.jpg"><img src="download.jpg" width="72" height="72" alt="" /></a>
-->
<div id="somehiddendiv"></div>
</body>