頁面滾動後,$.messager.show 彈窗跟著滾動,不再固定右下角。
<link rel="stylesheet" href="themes/default/easyui.css">
<style>
.messager-window { position: fixed !important; right: 10px; bottom: 10px; z-index: 9999; }
</style>
.messager-window(或 .window)。position: fixed 使其相對視口定位,脫離文檔流,滾動不再影響位置。!important 覆蓋組件內部 inline style。$.messager.show({
title: '提示',
msg: '內容',
style: { right: '', bottom: '' } // 清空內聯 right/bottom
});
// 配合 CSS fixed 即可
一段 CSS 徹底解決「滾動後彈窗跑偏」的煩惱。