open a fancybox from another fancybox....without closing the first?
Im using fancybox to show some content, and it is working fine.
But I also have inside my fancybox content, some links to open others fancyboxs that will show pdf´s.
And it is working fine, but When I close my last fancybx opened, I also close my first fancybox opened.
So, I came here to ask you, if it is possible, open a fancybox from another, but when you close the last opened fancybox, I want to go back to the first fancybox and not want them to be both closed, wich is what Im getting now.
I have this 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>
This is my fancybox script:
- $(document).ready(function() {
- $(".fancybox").fancybox({
- maxWidth : 800,
- fitToView : false,
- width : '80%',
- height : '80%',
- autoSize : false,
- closeClick : false,
- openEffect : 'elastic',
- closeEffect : 'elastic',
- });
- })
This is my fancybox script to open pdf:
- $(".fancybox_pdf").fancybox({
- width: '80%',
- height: '80%',
- autoSize: false,
- type: 'iframe',
- iframe: {
- preload: false
- }
- });