0

私はプロジェクトに取り組んでいます。私は fancybox インターフェースの知識が限られており、学習しながら学んでいます。これがシナリオです。Fancybox iFrame にリンクするページがあります。その iFrame 内に、Fancybox ギャラリーへのリンクがあります。この機能は問題なく動作しますが、ギャラリーを閉じると、以前に読み込まれた iFrame に戻りたいと思います。探しても探してもわかりません。

ここに私のメイン ページへのリンクと、問題の iframe があります

FancyboxギャラリーをロードするためにiFrameで実行したコードは次のとおりです。

<!-- 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>

どんな助けでも大歓迎です。

4

1 に答える 1

0

開いた iframe の名前を javascript 変数に入れ、ギャラリーに onClose イベントを設定して、変数に保存された iframe を開くことができます。

于 2013-09-27T18:20:58.677 に答える