在写客户端代码时,我想根据一个客户端的控件位置来设置另一个客户端的控件位置,用以下代码:
window.document.getElementById("div1").style.left=window.document.getElementById("sp1").style.left
window.document.getElementById("div1").style.top=window.document.getElementById("sp1").style.top
这样写好象没用,该如何写?各位大侠帮忙看看??!!^_^
首先div1的display要设置为absolute;
然后
div1.style.pixel = ...
div1.style.pixelLeft = ...
这个最好你到JavaScript论坛去问问,很多的。这儿主要解决c#方面的
搜索一下,动态位置,应该能解决你的问题,具体我忘记拉