0

ユーザーがコンテンツを左右に閲覧できるように、 data-fancybox-group="gallery" を使用している iframe ポップアップのリストがあります。このリストが置かれているページも iframe 内にあります。これは、soundcloud を介して連続して音楽を再生する必要があるため、メイン ヘッダーがリロードされないようにするためです。$('.fancybox').fancybox(); を修正する必要がありました。iframe コンテンツがコンテンツに合わせて自動的にサイズ変更され、親フレームの外に表示されるようにします。ただし、この修正されたスクリプトにより、ボタン機能が機能しなくなります。これは私のコードです。基本的に、ギャラリーのように機能するiframeボタン機能を取得する必要があります...

<script type="text/javascript">
    $(document).ready(function() {
        /*
         *  Simple image gallery. Uses default settings
         */

        $('.fancybox').click(function(e){
        e.preventDefault();
        parent.$.fancybox({'href'          : this.href, 
        'type':'iframe',

        autoSize : false});
         //fancybox
        return false;
        }); //click

        /*$('.fancybox').fancybox();*/

        /*
         *  Button helper. Disable animations, hide close button, change title type and content
         */

        parent.$('.fancybox-buttons').fancybox({
            openEffect  : 'none',
            closeEffect : 'none',

            prevEffect : 'none',
            nextEffect : 'none',

            closeBtn  : false,

            helpers : {
                title : {
                    type : 'inside'
                },
                buttons : {}
            },

            afterLoad : function() {
                this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
            }
        });


    });

</script>
4

0 に答える 0