簡體   English   中英

關閉圖庫后重新加載iframe

[英]Reload iframe after closing out of image gallery

我正在做一個項目。 我對fancybox界面的了解有限,我正在學習。 這是場景。 我有一個鏈接到Fancybox iFrame的頁面。 在該iFrame中,我有一個指向Fancybox畫廊的鏈接。 該功能工作正常,但是關閉圖庫后,我希望它返回到先前加載的iFrame。 我一直在搜尋,無法找到答案。

這是指向我的主頁以及相關iframe的鏈接。

這是我與iFrame一起運行以加載Fancybox畫廊的代碼:

<!-- Add jQuery library -->
<script type="text/javascript" src="fancyapps/lib/jquery-1.10.2.min.js"></script>

<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="fancyapps/source/jquery.fancybox.js?v=2.1.5">    </script>
<link rel="stylesheet" type="text/css" href="fancyapps/source/jquery.fancybox.css?v=2.1.5" media="screen" />

<!-- Add Button helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="fancyapps/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" />
<script type="text/javascript" src="fancyapps/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>

</script>
<script>
/* <![CDATA[ */
$(document).ready(function() {
$('.imagen').click(function(e){
    e.preventDefault();
parent.$.fancybox([
{href:'nicedesigns.jpg', title: 'This logo was made using Adobe Photoshop CS5.  The idea for this logo was the representation of a 3D effect without the need for any special software.  The inner colors were made using a blend of the Inner Shadow option in Photoshop.  And the 3D effect was made by creating numerous copies of the same layer and adjusting them slightly.'},
{href:'_3990424744.jpg', title: 'With this logo I was looking to make a water effect over any given letter.  This was achieved through the use of Adobe Photoshop CS5.  The water effect was created using a pre-made patter, and was repeated and resized numerous times.  The actual water effect along the bottom was created using a patter overlay on top of a layer mask.'},
{href:'_4891737295.jpg', title: 'I did this logo for my sons birthday party.  He fell in love with the Tron Legacy movie when that came out and wanted something that we could print onto a t-shirt.  This effect was achieved through the use of Adobe Photoshop CS5.  I used a Tron typeface to create the original letters, and then used a mixture of Outer and Inner Glow effects to brighten the lettering.  Finally I used a layer mask to copy the original text and reverse it to create the lower reflection.'}
],{
//          href: this.href,
        helpers: {
            overlay: {
            opacity: 0.3
            }, // overlay
            title : {
                type : 'inside'
            }
            //, buttons: {}
        } // helpers
    }); // fancybox
}); // click

$('.imagen2').click(function(e){
    e.preventDefault();
parent.$.fancybox([
{href:'neverendingmall.jpg', title: 'This is a mock website created for one of my courses at DeVry University.  I was the project manager for this course and had a group of five designers under me.  We each had three store websites we had individually created, and then combined them to form the Neverending Mall website.  I provided the overall layout, color design, employment application form, and Spry Menus.  This site can be viewed at the following address.  http://mnice.mydevryportfolio.com/WGD242/Week8/'},
{href:'tutorial.jpg', title: 'This is a mock tutorial website created for one of my courses at DeVry University.  I was responsible for the complete creation of the website, from start to finish.  I used a blend of Adobe Dreamweaver to build the overall site, Adobe Flash for the banner, and Screen capture software for the videos.'},
{href:'wcoilmobile.PNG', title: 'This is an official website for one of my employers.  I was tasked with converting their main website into a mobile friendly version.  This was achieved through the use of Adobe Dreamweaver, CSS templates, and Adobe Photoshop to create the button links.'}
],{
//          href: this.href,
        helpers: {
            overlay: {
            opacity: 0.3
            }, // overlay
            title : {
                type : 'inside'
            }
            //, buttons: {}
        } // helpers
    }); // fancybox
}); // click
$('.imagen3').click(function(e){
    e.preventDefault();
parent.$.fancybox([
{href:'flash1.png', title: 'This Flash animation was created for one of my DeVry University courses.  It was created using Adobe Flash Professional.  A full version of this animation can be seen at <a href="http://mnice.mydevryportfolio.com/WGD250/Tutorial/" target="_new">This Link</a>'},
{href:'tutorial.jpg', title: '02'},
{href:'wcoilmobile.PNG', title: '03'}
],{
//          href: this.href,
        helpers: {
            overlay: {
            opacity: 0.3
            }, // overlay
            title : {
                type : 'inside'
            }
            //, buttons: {}
        } // helpers
    }); // fancybox
}); // click

}); // ready
/* ]]> */
</script>

任何幫助表示贊賞。

您可以將打開的iframe的名稱放在javascript變量上,並在圖庫中設置onClose事件以打開保存在變量中的iframe。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM