Hi,
In my webpage there are three Frames and on top these frames I am
showing a calculator tool constructed in a DIV element, and we have a
small button(input type="button") in the calculator with label as
"Hold down and Drag to Move" with dragging functionality to move the
calculator on the entire page which is working perfectly/smoothly on
IE and Firefox browsers with the below specified code, but not freely
moving on Safari. When we press the mouse key, hold and drag, the hold
move icon is losing the focus from the calculator drag button element
and stopping the movement. Its not smoothly dragging as happening in
IE and Firefox. Testing on a Safari browser version 4.0.4.
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
========================================================================
var tmpX = 0
var tmpY = 0
var evntObj;
function getMouseXY(e) {
if (IE) {
evntObj = (event) ? event : e;
tmpX = evntObj.clientX + document.body.scrollLeft
tmpY = evntObj.clientY + document.body.scrollTop
evntObj = null;
} else {
tmpX = e.pageX
tmpY = e.pageY
}
if (tmpX < 0){tmpX = 0}
if (tmpY < 0){tmpY = 0}
}
------------------------------
function initFreeMove(e,isCalc){ //called onmousedown of the
calculator "Hold down & Drag to Move" button
isCal = isCalc;
cMI = true;
getMouseXY(e);
if(isCal){
tmpErrX=75;
tmpErrY=20;
hitCal = true;
}
mIO = (isCal) ? getDOMObj("calculator") : ((IE==true) ?
e.srcElement : e.target);
}
function processFreeMove(ev){ //called onmousemove of the
calculator "Hold down & Drag to Move" button
if(cMI == true){
getMouseXY(ev);
if (isCal){
mIO.style.left= (tmpX - tmpErrX) + 'px';
mIO.style.top= (tmpY - tmpErrY) + 'px';
if (bH < (mIO.style.pixelHeight +
mIO.style.pixelTop)){
mIO.style.pixelTop = bH -
mIO.style.pixelHeight - 15;
cMI = false;
}
if (bW < (mIO.style.pixelWidth/2 +
mIO.style.pixelLeft)){
mIO.style.pixelLeft = bW -
mIO.style.pixelWidth - 15;
cMI = false;
}
}
}
}
-------------------------
function stopFreeMove(e){ //called onmouseup of the calculator
"Hold down & Drag to Move" button
cMI=false;
hitCal = false;
}
---------------------HTML Code----------------------------
<div id="calculator" align="center" style="background-
color:#cccccc;position:absolute;width:195px;height:150px;border:0px
dotted gray;display:none;padding:0px;z-index:50;">
<TABLE BORDER=4 cellspacing=0>
<TR>
<TD align="left">
<INPUT TYPE="button" style="background-
color:#000000;color:#ffffff;font-size:10;" Size="23" value="Hold down
& Drag to Move " onmousemove="processFreeMove(event);"
onmousedown="initCalcMove(event);"
onmouseup="stopCalcMove(event);document.selection.empty();"
onkeydown="return false;" onmouseover="this.style.cursor='Move';" /
>& Drag to Move</label> <button onclick="hideCalculator();"
style="font-size:10;font-weight:bold;background-color:#ff3300;"
title="Click to Close">X</button>
........
.....
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
========================================================================
Any help would be appreciated.
Thanks,
Raghavender.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]