0
我在我的頁面底部並單擊一個按鈕打開我的模態對話框。該對話框彈出在我的屏幕中心,就像它應該,但是文檔滾動到頁面的頂部!當我打開對話框時,我不希望文檔滾動到任何地方。現在我必須手動滾動到頁面底部才能看到對話框。這是不好的,因爲用戶只能看到一個空的黑暗頁面,沒有對話框可見。jQueryUI滾動到頂部bug
jQueryUI的:
$(dialogBox).dialog({
autoOpen: false,
modal: true,
draggable: false,
resizable: false,
width: 'auto',
//show: effect,
//hide: effect,
//open: function(event, ui) {
//$('html').css('overflow', 'hidden');
//},
//close: function (event, ui) {
//$('html').css('overflow', 'auto');
//}
});
的OnClick:
parent.dialogBox.dialog("open");
謝謝!
你能張貼產生按鈕代碼?聽起來你可能與'href ='#''(或類似的)有鏈接,並導致滾動。 –
好主意,讓我檢查一下。 – Exegesis