so i got script like that
[HTML]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Drag and Drop</title>
<style>
#slater {
display:block;
width:13px;
height:22px;
background:url( slater.gif);
cursor:pointer;
position:relati ve;
border:0px;
}
#main_box {
position:relati ve;
width:113px;
height:22px;
background:url( background_slat e.jpg) no-repeat;
border:0px;
}
</style>
<script>
if (navigator.appN ame == "Microsoft Internet Explorer") { var Browser = "IE"; } else { var Browser = "FF"; }
var MoveIT = "";
function startDrag() {
OffsetX = MouseX - (document.getEl ementById('slat er').style.left ).replace("px", "");
MoveIT = "yes";
}
function mouseMoveFF(eve nt) {
MouseX = event.clientX;
if (MoveIT == "yes") {
document.getEle mentById('slate r').style.left = MouseX - OffsetX;
if(document.get ElementById('sl ater').style.le ft.replace("px" ,"") <= 0) {
document.getEle mentById('slate r').style.left = 0+"px";
} else if ((document.getE lementById('sla ter').style.lef t.replace("px", "")) >= 100) {
document.getEle mentById('slate r').style.left = 100+"px";
}
var speed = document.getEle mentById('slate r').style.left. replace("px","" ) / 10;
var fix_pt = (document.getEl ementById('slat er').style.left != "0pt") ? speed : '0';
document.getEle mentById('speed ').innerHTML = fix_pt;
}
}
function mouseMoveIE() {
MouseX = event.clientX;
if (MoveIT == "yes") {
document.getEle mentById('slate r').style.left = MouseX - OffsetX;
if(document.get ElementById('sl ater').style.le ft.replace("px" ,"") <= 0) {
document.getEle mentById('slate r').style.left = 0+"px";
} else if ((document.getE lementById('sla ter').style.lef t.replace("px", "")) >= 100) {
document.getEle mentById('slate r').style.left = 100+"px";
}
var speed = document.getEle mentById('slate r').style.left. replace("px","" ) / 10;
document.getEle mentById('speed ').innerHTML = speed;
}
}
if (Browser == "IE") { document.onmous emove = mouseMoveIE; } else { document.onmous emove = mouseMoveFF; }
document.onmous eup = function () { MoveIT = ""; }
</script>
</head>
<body>
<div id="main_box">
<div id="slater" onMouseDown="st artDrag()"></div>
</div>
<div id="speed" style="font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#666666;" >0</div>
</body>
</html>
[/HTML]
so it works file but this is my problem it's made on <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> HTML 4.0 Transitional i need it to be <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d"> but this i my problem when i change HTML 4.0 Transitional to XHTML 1.0 Transitional it stops working so can some one tell me how to make my script work with XHTML 1.0 Transitional (on ie XHTML 1.0 Transitional works but not on FF)
[HTML]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Drag and Drop</title>
<style>
#slater {
display:block;
width:13px;
height:22px;
background:url( slater.gif);
cursor:pointer;
position:relati ve;
border:0px;
}
#main_box {
position:relati ve;
width:113px;
height:22px;
background:url( background_slat e.jpg) no-repeat;
border:0px;
}
</style>
<script>
if (navigator.appN ame == "Microsoft Internet Explorer") { var Browser = "IE"; } else { var Browser = "FF"; }
var MoveIT = "";
function startDrag() {
OffsetX = MouseX - (document.getEl ementById('slat er').style.left ).replace("px", "");
MoveIT = "yes";
}
function mouseMoveFF(eve nt) {
MouseX = event.clientX;
if (MoveIT == "yes") {
document.getEle mentById('slate r').style.left = MouseX - OffsetX;
if(document.get ElementById('sl ater').style.le ft.replace("px" ,"") <= 0) {
document.getEle mentById('slate r').style.left = 0+"px";
} else if ((document.getE lementById('sla ter').style.lef t.replace("px", "")) >= 100) {
document.getEle mentById('slate r').style.left = 100+"px";
}
var speed = document.getEle mentById('slate r').style.left. replace("px","" ) / 10;
var fix_pt = (document.getEl ementById('slat er').style.left != "0pt") ? speed : '0';
document.getEle mentById('speed ').innerHTML = fix_pt;
}
}
function mouseMoveIE() {
MouseX = event.clientX;
if (MoveIT == "yes") {
document.getEle mentById('slate r').style.left = MouseX - OffsetX;
if(document.get ElementById('sl ater').style.le ft.replace("px" ,"") <= 0) {
document.getEle mentById('slate r').style.left = 0+"px";
} else if ((document.getE lementById('sla ter').style.lef t.replace("px", "")) >= 100) {
document.getEle mentById('slate r').style.left = 100+"px";
}
var speed = document.getEle mentById('slate r').style.left. replace("px","" ) / 10;
document.getEle mentById('speed ').innerHTML = speed;
}
}
if (Browser == "IE") { document.onmous emove = mouseMoveIE; } else { document.onmous emove = mouseMoveFF; }
document.onmous eup = function () { MoveIT = ""; }
</script>
</head>
<body>
<div id="main_box">
<div id="slater" onMouseDown="st artDrag()"></div>
</div>
<div id="speed" style="font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#666666;" >0</div>
</body>
</html>
[/HTML]
so it works file but this is my problem it's made on <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> HTML 4.0 Transitional i need it to be <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d"> but this i my problem when i change HTML 4.0 Transitional to XHTML 1.0 Transitional it stops working so can some one tell me how to make my script work with XHTML 1.0 Transitional (on ie XHTML 1.0 Transitional works but not on FF)
Comment