• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Mouse events - HTML Div element - Dragging Issue - On Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mouse events - HTML Div element - Dragging Issue - On Safari


  • Subject: Mouse events - HTML Div element - Dragging Issue - On Safari
  • From: Raghavender <email@hidden>
  • Date: Thu, 7 Jan 2010 19:58:57 +0530

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 "   />&amp; Drag to Move</label>&nbsp;<button 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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: FrontBase 5
  • Next by Date: Re: Best way to run period task?
  • Previous by thread: RE: FrontBase 5
  • Next by thread: OT: Why this list is so valuable
  • Index(es):
    • Date
    • Thread