试图从另一个打开一个fancybox但没有关闭第一个?

时间:2014-05-20 15:19:28

标签: jquery jquery-plugins fancybox fancybox-2

我使用fancybox显示一些内容,它运行正常。

但我也有我的fancybox内容,一些链接打开其他显示pdf的fancybox。

它工作正常,但当我关闭我的最后一个fancybx打开时,我也关闭了我的第一个fancybox打开。

所以,我来这里问你,如果有可能的话,打开另一个花哨的盒子,但当你关闭最后一个打开的花式盒时,我想回到第一个花式盒而不想让它们都关闭,这就是我现在所得到的。

我有这个HTML:

<article class="loop-news">
  <h2>Title</h2>
  <span>Date of today</span>
  <p>content of my article</p>
  <a class="fancybox" href="#show">Read more</a>

//then I have my div that will appear inside fancybox when click on "read more"

  <div class="fancybox-container">
    <div id="show">
      echo <h2>Title</h2>
      <span>Date of today</span>
      <p>content of my news</p>
//here I have some pdfs inside fancybox, that will open other fancybox
    <div  class="pdfs">
      <li><a class="fancybox_pdf" href="pdf1.pdf">Title of pdf</a></li>
      <li><a class="fancybox_pdf" href="pdf1.pdf">Title of pdf</a></li>
   </div>
  </div>
</article>

这是我的fancybox脚本:

$(document).ready(function() {
    $(".fancybox").fancybox({
        maxWidth    : 800,
        fitToView   : false,
        width       : '80%',
        height      : '80%',
        autoSize    : false,
        closeClick  : false,
        openEffect  : 'elastic',
        closeEffect : 'elastic',    
    });
})

这是我打开pdf的fancybox脚本:

    $(".fancybox_pdf").fancybox({
        width: '80%',
        height: '80%',
    autoSize: false,
        type: 'iframe',
        iframe: {
          preload: false
        }
}); 

0 个答案:

没有答案
相关问题