2012-03-28 67 views
1

我在加載第二個圖庫後全屏大小調整停止工作時出現問題。它在load()調用之前完美工作。我試圖獲得有關rescale()函數的更多信息,但還沒有找到讓它工作的方法。Galleria resize stop load()

// backstage 
    var firstGallery = [ 
    { 
     image: "img/bg1.jpg" 
    }, 
    { 
     image: "img/bg2.jpg" 
    }, 
    { 
     image: "img/bg3.jpg" 
    } 
    ]; 


    // work commercial 
    var secondGallery = [ 
    { 
     image: "img/commers1.jpg" 
    }, 
    { 
     image: "img/commers2.jpg" 
    }, 
    { 
     image: "img/commers3.jpg" 
    } 
    ]; 

    // Load fullscreen theme 
    Galleria.loadTheme('galleria/themes/fullscreen/galleria.fullscreen.min.js'); 

    // Intialize Galleria 
    $('#gallery').galleria(
    { 
     dataSource: firstGallery, 
     imageCrop: true, 
     autoplay: true, 
     transition: "slide", 
     thumbnails: false, 
     showInfo: true, 
     clicknext: true, 
     preload: 4, 
     swipe: true, 

     // maxScaleRatio: 1 
    } 
); 


    $('#workEditorial').click(function() { 
    // byter ut bilderna i #gallery diven 
    Galleria.get(0).load(secondGallery); 
    Galleria.get(0).setOptions('imageCrop', 'false'); 

    }); 

    $('#backstage').click(function() { 
    Galleria.get(0).load(firstGallery); 
    Galleria.get(0).setOptions('imageCrop', 'true'); 
    }); 

回答

0

你可以嘗試調用.rescale()setOptions

Galleria.get(0).setOptions('imageCrop', 'false').rescale(); 
+0

謝謝大衛的回答。我曾嘗試過,但沒有結果。 – 2012-04-02 11:44:35

+0

還有其他建議嗎?似乎主題是在load()中丟失的,並且不可能是正確的... – 2012-04-03 12:18:48