chaz
01-10-2008, 07:00 AM
Hi
I have to convert setcapture from IE into firefox. Here is a script similiar to the one I have to convert. How do I make this work in FireFox???
Looking forward to your reply.
Regards
Chaz
<HTML>
<HEAD>
<TITLE>Track Ball</TITLE>
<STYLE>
<!--
#oTrackBall {
position:absolute;
left:170;
top:200;
}
-->
</STYLE>
<SCRIPT>
<!--
var iRadius = 30;
var iXcenter = 250;
var iYcenter = 170;
var capture = true;
function fnSwitchCapture(obj) {
if (capture) {
capture = false;
obj.releaseCapture();
}
else {
capture = true;
obj.setCapture();
}
}
function doImgMouseMove()
{
var iXdistance = event.x - iXcenter;
var iYdistance = event.y - iYcenter;
var distance = Math.sqrt(iXdistance * iXdistance + iYdistance * iYdistance);
oTrackBall.style.left = iXcenter + iRadius * iXdistance / distance;
oTrackBall.style.top = iYcenter + iRadius * iYdistance / distance;
}
-->
</SCRIPT>
</HEAD>
<BODY onload="oTrackBall.setCapture()" onclick="fnSwitchCapture(oTrackBall)"> <BR>
<CENTER><H2>Simple Animation with setCapture() and releaseCapture()</H2></CENTER>
<IMG ID="oTrackBall" onmousemove="doImgMouseMove()" SRC="black.gif" alt="black sphere">
</BODY>
</HTML>
I have to convert setcapture from IE into firefox. Here is a script similiar to the one I have to convert. How do I make this work in FireFox???
Looking forward to your reply.
Regards
Chaz
<HTML>
<HEAD>
<TITLE>Track Ball</TITLE>
<STYLE>
<!--
#oTrackBall {
position:absolute;
left:170;
top:200;
}
-->
</STYLE>
<SCRIPT>
<!--
var iRadius = 30;
var iXcenter = 250;
var iYcenter = 170;
var capture = true;
function fnSwitchCapture(obj) {
if (capture) {
capture = false;
obj.releaseCapture();
}
else {
capture = true;
obj.setCapture();
}
}
function doImgMouseMove()
{
var iXdistance = event.x - iXcenter;
var iYdistance = event.y - iYcenter;
var distance = Math.sqrt(iXdistance * iXdistance + iYdistance * iYdistance);
oTrackBall.style.left = iXcenter + iRadius * iXdistance / distance;
oTrackBall.style.top = iYcenter + iRadius * iYdistance / distance;
}
-->
</SCRIPT>
</HEAD>
<BODY onload="oTrackBall.setCapture()" onclick="fnSwitchCapture(oTrackBall)"> <BR>
<CENTER><H2>Simple Animation with setCapture() and releaseCapture()</H2></CENTER>
<IMG ID="oTrackBall" onmousemove="doImgMouseMove()" SRC="black.gif" alt="black sphere">
</BODY>
</HTML>