Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/376.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Fancybox:如何滚动HTML片段而不是具有相同效果的图像?_Javascript_Html_Fancybox_Fancybox 2 - Fatal编程技术网

Javascript Fancybox:如何滚动HTML片段而不是具有相同效果的图像?

Javascript Fancybox:如何滚动HTML片段而不是具有相同效果的图像?,javascript,html,fancybox,fancybox-2,Javascript,Html,Fancybox,Fancybox 2,我希望显示HTML片段,而不是具有相同滚动效果的图像(当我们调用next()方法时)。 我不知道如何使它工作。我们可以用一个html片段显示fancybox: $.fancybox( htmlFragment ); 但是我想要一些碎片。如何强制解放。使用HTML片段而不是图像 为什么我需要它:我必须创建一个包含多个表单的弹出式向导。您可以将html片段作为内联内容 <div style="display: none"> <div id="section1">

我希望显示HTML片段,而不是具有相同滚动效果的图像(当我们调用next()方法时)。

我不知道如何使它工作。我们可以用一个html片段显示fancybox:

$.fancybox( htmlFragment );
但是我想要一些碎片。如何强制解放。使用HTML片段而不是图像


为什么我需要它:我必须创建一个包含多个表单的弹出式向导。

您可以将html片段作为
内联
内容

<div style="display: none">
    <div id="section1">
        <h1>Section One</h1>
        ...content
    </div>
    <div id="section2">
        <h1>Section Two</h1>
        ...content
    </div>
    <div id="section3">
        <h1>Section Three</h1>
        ...content
    </div>

    ... etc
</div>
请参见

当您说“滚动片段”时,您是指html块库吗?
<a rel="gallery" class="fancybox" href="#section1">open section one</a>
<a rel="gallery" class="fancybox" href="#section2">open section two</a>
<a rel="gallery" class="fancybox" href="#section3">open section three</a>
$(".fancybox").fancybox();