左邊iframe放樹目錄,右邊的iframe放index頁。拖曳滑鼠同時控制2個iframe的寬高。 期待有人能改進。 操作方法:滑鼠指到2個iframe中間,可以水平拖,縱向拖(控制高度)缺點:CSDN頁面放開滑鼠後才改大小,不佔CPU資源。 這個是即時改大小,所以速度太慢,希望有人來改改。我是不想弄了,反正又沒用什麼特別的技術。 提示:拖曳的秘密就在filter:alpha(opacity=0)這句話 複製程式碼 程式碼如下: <BR> var mouseX = 0; <BR> var mouseY = 0;<BR> var=5; function divonmousemove(){ <BR> obj1=document.getElementById("a");<BR> obj2=document.getElementById("b");<BR> obj12=document.getElementById( if (mouseX!==event.x && mouseY!==event.y)obj12.style.cursor='se-resize'; <BR> else if (mouseX!==event.x)obj12.style.cursor= 'e-resize'; <BR> else if (mouseY!==event.y)obj12.style.cursor='s-resize'; <BR> else obj12.style.cursor=''; <BR> if ( event.button==1){ <BR> obj1.style.width=parseInt(obj1.offsetWidth) (event.x - mouseX); <BR> mouseX=event.x;<BR> obj1.style.height=parseInt. (obj1.offsetHeight) (event.y - mouseY); <BR> mouseY= event.y; <BR> obj12.style.width=108;<BR> obj12.style.left=obj1.108;<BR> obj12.style.left=obj1.108;<BR> obj12.style.left=obj1.obj1. 2;<BR> obj12.style.height=obj1.clientHeight;<BR> obj2.style.height=obj1.clientHeight;<BR> obj2.style.left=obj1.clientWidth;<BR> obj2.style.left=obj1.clientWidthth;< =screen.width-obj1.offsetWidth-w;<BR> }} <BR>function divonmousedown(){ <BR> mouseX = event.x; <> mouseY = event. divonmouseup(){ <BR> obj12.style.left=obj1.offsetWidth;<BR> obj12.style.width=w;<BR> mouseX = 0; <BR> mouse = 0; <BR> <body style='margin:0'><BR> <iframe zindex=1 id="a" src="http://www.jb51.net/Tree/tree.htm" style="width: 200;height:610;position:absolute;z-index:9 "><BR> <div zindex=0 id='ab' onmousemove='divonmousemove();' onmouseleave='document.getElementById(" ab").style.cursor='';' <BR> onmousedown='divonmousedown();' onmouseup='divonmouseup();' <BR> style='filter:alpha(opacity=0);width:5; height:799;background:#aaffaa;position:absolute;left:200;z-index:100' title='按滑鼠拖曳大小'>