Overlay.js me raéjoute un contenaire trop grand

mikeborne Messages postés 2 Date d'inscription samedi 22 novembre 2008 Statut Membre Dernière intervention 7 mars 2009 - 7 mars 2009 à 02:42
mikeborne Messages postés 2 Date d'inscription samedi 22 novembre 2008 Statut Membre Dernière intervention 7 mars 2009 - 7 mars 2009 à 02:43
Voilà je suis pret à me jeter par la fenêtre comme c'est si bien dit dans le titre.

J'utilise multibox de phatfusion avec le script overlay.js.

Le souci est que dans le script, la hauteur du container est trop importante, du coup, j'ai un grand espace de html vide à la fin de ma page. Je suis débutant en script. J'ai bien ciblé l'endroit ou la hauteur est déterminée mais je ne suis parvenu à rien.

voilà le script

var Overlay = new Class({

getOptions: function(){
return {
colour: '#000',
opacity: 0.7,
zIndex: 1,
container: document.body,
onClick: Class.empty
};
},

initialize: function(options){
this.setOptions(this.getOptions(), options);

this.options.container = $(this.options.container);

this.container = new Element('div').setProperty('id', 'OverlayContainer').setStyles({
position: 'absolute',
left: '0px',
top: '0px',
width: '100%',
zIndex: this.options.zIndex
}).injectInside(this.options.container);

this.iframe = new Element('iframe').setProperties({
'id': 'OverlayIframe',
'name': 'OverlayIframe',
'src': 'javascript:void(0);',
'frameborder': 1,
'scrolling': 'no'
}).setStyles({
'position': 'absolute',
'top': 0,
'left': 0,
'width': '100%',
'height': '100%',
'filter': 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)',
'opacity': 0,
'zIndex': 1
}).injectInside(this.container);

this.overlay = new Element('div').setProperty('id', 'Overlay').setStyles({
position: 'absolute',
left: '0px',
top: '0px',
width: '100%',
height: '100%',
zIndex: 2,
backgroundColor: this.options.colour
}).injectInside(this.container);

this.container.addEvent('click', function(){
this.options.onClick();
}.bind(this));

this.fade = new Fx.Style(this.container, 'opacity').set(0);
this.position();

window.addEvent('resize', this.position.bind(this));
},

position: function(){ 
if(this.options.container == document.body){ 
var h = window.getScrollHeight()+'px'; 
this.container.setStyles({top: '0px', height: h}); 
}else{ 
var myCoords = this.options.container.getCoordinates(); 
this.container.setStyles({
top: myCoords.top+'px', 
height: myCoords.height+'px', 
left: myCoords.left+'px', 
width: myCoords.width+'px'
}); 
} 
},

show: function(){
this.fade.start(0,this.options.opacity);
},

hide: function(){
this.fade.start(this.options.opacity,0);
}

});
Overlay.implement(new Options);



Merci d'avance pour votre aide.

1 réponse

mikeborne Messages postés 2 Date d'inscription samedi 22 novembre 2008 Statut Membre Dernière intervention 7 mars 2009
7 mars 2009 à 02:43
Merde! J'ai pourtant mis mon code entre balises
.....Désolé c'est pas très lisible!
0
Rejoignez-nous