opacity: 0.6)var dragobj = {};
var domid = 12; // 動態 ID 計數器
// 瀏覽器特性偵測
window.isIE = navigator.userAgent.includes('IE') && !window.isOpr;
window.isMoz = navigator.userAgent.includes('Mozilla') && !window.isOpr && !window.isIE;
// 統一事件座標存取(Firefox 修正)
if (window.isMoz) {
Event.prototype.__defineGetter__('x', function() { return this.clientX + 2; });
Event.prototype.__defineGetter__('y', function() { return this.clientY + 2; });
}
// 基礎工具函式
window.$ = function(obj) { return typeof obj == 'string' ? document.getElementById(obj) : obj; };
window.oDel = function(obj) { var el = $(obj); if (el) el.parentNode.removeChild(el); };
// 初始化:為所有 h1 綁定拖曳、新增摺疊/關閉按鈕
window.onload = function() {
on_ini();
var headers = document.getElementsByTagName('h1');
for (var i = 0; i < headers.length; i++) {
headers[i].onmousedown = addevent;
// 動態建立摺疊/關閉控制項...
}
};
addEventListener/attachEvent,統一 clientX/Y 存取。createElement + appendChild,新增元素即時綁定互動邏輯。dragobj 記錄被拖曳元素、初始座標、偏移量,document.onmousemove/up 全域監聽。.dragging 樣式(半透明),釋放後移除。可整合 localStorage 持久化面板位置/狀態,打造個性化儀表板;搭配 AJAX 載入面板內容,實現真正的 Portal 頁面定製化。