一段代码,IE可以,firefox怎么不行?div 拖动
var x,y;
function mousedown(obj)
{
obj.onmousemove = mousemove;
obj.onmouseup = mouseup;
oEvent = window.event ? window.event : arguments.callee.caller.arguments[0];
x = oEvent.clientX;
y = oEvent.clientY;
}
function mousemove()
{
oEvent = window.event ? window.event : arguments.callee.caller.arguments[0];
var _top = oEvent.clientY - y + parseInt(this.style.top) + "px"; var _left = oEvent.clientX - x + parseInt(this.style.left) +"px";
this.style.top = _top;
this.style.left = _left;
x = oEvent.clientX;
y = oEvent.clientY
}
function mouseup()
{
this.onmousemove = null;
this.onmouseup = null;
}
...全文
相关推荐
兼容IE与火狐的拖动div效果
通过以上步骤,我们可以创建一个兼容IE和Firefox的拖动div效果。这个功能不仅限于div,也可以应用于其他可拖动的HTML元素。
可拖动div层,兼容IE火狐等浏览器
这个功能在jQuery库的支持下,可以实现跨浏览器的兼容性,包括Internet Explorer(IE)、Firefox等主流浏览器。
div中子div在firefox ie 水平居中对齐
因此,添加以下CSS样式可以实现在Firefox和IE中均能居中的效果:```cssdiv div { margin-left: auto; margin-right: auto;}```这段代码针对父
IE6,IE7和firefox对DIV的支持区别
### IE6、IE7 和 Firefox 对 DIV 的支持区别详解#### 一、引言随着 Web 技术的发展,浏览器的兼容性问题一直是前端开发者关注的重点。
javascript实现拖动层效果代码(符合标准且兼容IE,chrome,firefox)
浏览器兼容性问题:文档中提到需要兼容IE、Chrome和Firefox,这意味着需要处理不同浏览器间可能存在的一些差异。


