Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    getPageSize: problema barre di scorrimento

    ciao! ho un problema con lightbox che penso sia riconducibile alla funzione in oggetto: nel momento in cui viene caricata un'immagine più grande della finestra del browser appaiono le barre di scorrimento (sia verticale che orizzontale) creando, al cambio dell'immagine, un fastidioso movimento dello schermo. E' possibile eliminare la creazione della barra orizzontale (non necessaria alla mia galleria)? Graaaazzz

    FUNZIONE: getPageSize: function() {

    var xScroll, yScroll;

    if (window.innerHeight && window.scrollMaxY) {
    xScroll = window.innerWidth + window.scrollMaxX;
    yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
    xScroll = document.body.scrollWidth;
    yScroll = document.body.scrollHeight;
    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
    xScroll = document.body.offsetWidth;
    yScroll = document.body.offsetHeight;
    }

    var windowWidth, windowHeight;

    if (self.innerHeight) { // all except Explorer
    if(document.documentElement.clientWidth){
    windowWidth = document.documentElement.clientWidth;
    } else {
    windowWidth = self.innerWidth;
    }
    windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
    windowWidth = document.documentElement.clientWidth;
    windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
    windowWidth = document.body.clientWidth;
    windowHeight = document.body.clientHeight;
    }

    // for small pages with total height less then height of the viewport
    if(yScroll < windowHeight){
    pageHeight = windowHeight;
    } else {
    pageHeight = yScroll;
    }

    // for small pages with total width less then width of the viewport
    if(xScroll < windowWidth){
    pageWidth = xScroll;
    } else {
    pageWidth = windowWidth;
    }

    return [pageWidth,pageHeight];
    }

    CHE VIENE RICHIAMATA QUI:
    start: function(imageLink) {

    $$('select', 'object', 'embed').each(function(node){ node.style.visibility = 'hidden' });

    // stretch overlay to fill page and fade in
    var arrayPageSize = this.getPageSize();
    $('overlay').setStyle({ width: arrayPageSize[0] + 'px', height: arrayPageSize[1] + 'px' });

    new Effect.Appear(this.overlay, { duration: this.overlayDuration, from: 0.0, to: LightboxOptions.overlayOpacity });

    this.imageArray = [];
    var imageNum = 0;

    if ((imageLink.rel == 'lightbox')){
    // if image is NOT part of a set, add single image to imageArray
    this.imageArray.push([imageLink.href, imageLink.title]);
    } else {
    // if image is part of a set..
    this.imageArray =
    $$(imageLink.tagName + '[href][rel="' + imageLink.rel + '"]').
    collect(function(anchor){ return [anchor.href, anchor.title]; }).
    uniq();

    while (this.imageArray[imageNum][0] != imageLink.href) { imageNum++; }
    }

  2. #2
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    Direi di no, dato che se lo script fa proprio riferimento alla scroll/barre della finistra e del body e del documento
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.