When I try moving an element by settings its style (e.g: document.getElementById('test').style.left ) It comes that in firefox it won't work without adding 'px' to the value. Example below:
Not Working:
Mã HTML:
document.getElementById('test').style.left = arrPostion[0];
document.getElementById('test').style.top = arrPostion[1];
Working:
Mã HTML:
document.getElementById('test').style.left = arrPostion[0]+'px';
document.getElementById('test').style.top = arrPostion[1]+'px';
This is, however, only apply for XHTML 1.0 Transitional. To know if your page is using XHTML 1.0 Transitional, view its source and if there is the line "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">" at top before <html> it's using XHTML 1.0 Transitional standard.
The page looks like this:
Mã HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
read more about XHTML
I'm still having problem with moving elements in IE under XHTML standard. I will give an update about this soon.