由於在easyui中$.messager.show() 只有一種彈出方式(在瀏覽器的或下角彈出),我最近在做一個項目的時候需要在瀏覽器的頂部中間出現。由於自己寫花那么多的時間,所以就去修改了原碼(不推薦,由於我其他地方沒有用,只有一個地方在用)。
把jquery.easyui.min.js中第3046行里的style修改一下就可以了
left:document.documentElement.offsetWidth/2-125,top:document.documentElement.offsetTop,right:"",zIndex:$.fn.window.defaults.zIndex++,bottom:""
就像這樣了。
$.messager.show({ style:{ right:'', top:document.body.scrollTop+document.documentElement.scrollTop, bottom:'' } });