2012-08-30 40 views
0

我使用fancybox iframe來顯示內容,但是當我滾動頁面頁面時,Iframe不在頁面的中心。滾動時,我希望Iframe始終位於頁面的中心位置。我正在使用這個腳本。Fancybox Iframe不在頁面的中心

$("#various2").fancybox({ 
    width: 520, 
    height: 550, 
    autoScale: false, 
    transitionIn: 'none', 
    transitionOut: 'none', 
    type: 'iframe', 
    scrolling: 'no', 
    centerOnScroll: 'true', 
    autoCenter: 'true' 
}); 

任何人都可以幫助我。

在此先感謝

+0

一些CSS規則覆蓋的fancybox的呢? – Napolux

+0

「操作方法」取決於您使用的fancybox的版本,因爲在腳本中,您將包含v1.3.x和v2.x的API選項,這些API選項彼此不兼容。所以64,000美元的問題是:你使用的是什麼fancybox版本? – JFK

回答

2

我真的不知道,但通過看你的代碼,我可以看到你輸入布爾值作爲字符串 -

$("#various2").fancybox({ 
    width: 520, 
    height: 550, 
    autoScale: false, 
    transitionIn: 'none', 
    transitionOut: 'none', 
    type: 'iframe', 
    scrolling: 'no', 
    centerOnScroll: true, // and not 'true', 
    autoCenter: true // and not 'true' 
}); 
+0

我做了這些更改,但它不起作用。 – Sheeraz

+0

適合我 - http://jsfiddle.net/MCC23/ – Janis