Projet Socle ENT
Pages enfant
  • Retaillage d'iframe

Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Bloc de code
/*********************************************

Resize d'iframe

*********************************************/
(function($){
    $(document).ready(function(){
    
        var resizeFrames = function() {
            $('iframe').each(function(){            
                var height_window = $(window).height();
                
                // do not open other iframe
                // direct child of up-portlet-content-wrapper-inner
                if($(this).parent().get(0).className == 'up-portlet-content-wrapper-inner') {
                    newHeight = height_window-210;
                    this.height=newHeight+"px";
                
                    $('#portalPageFooter').hide();
                }
            });
        }
        
        $(window).resize(function() {
            resizeFrames();
        });

        resizeFrames();
    });
})(jQuery);

...

(nb : testé avec uPortal 3.2 et tous les navigateurs testés : Firefox 3.6, Chrome 8.0, Safari, IE 8. Ne fonctionne pas avec IE6/IE7 qui ne gèrent pas postMessage)

Le portail qui reçoit la hauteur du contenu des iframes et ajuste la hauteur de l'iframe.
Cette solution fonctionne avec toutes les applications testées, même celles utilisant de l'ajax pour construire la page affichée.

...

Installer postMessage-resize-iframe-in-parent.js pour le rendre accessible aux applications (ex : http://xxx.univ.fr/zzz/postMessage-resize-iframe-in-parent.jsImage Removed).

Dans l'application

...