Closed Bug 237997 Opened 20 years ago Closed 20 years ago

I cannot get CSSP to work. I am trying to move a SPAN around the page

Categories

(Core :: DOM: CSS Object Model, defect)

x86
Windows 2000
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: krochele, Unassigned)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113

Given the following JAVASCRIPT when event onMouseOver happens I execute ttOn() 
and when onMouseOut happens I execute ttOff().  The visibility and display 
parts work fine the positioning parts do not work at all.  I have spent two 
days reading and trying all the combinations of things I can think of to no 
avail.  It works in IE, does not work in MOZILLA, FireBird, netscape 6.1

<script language="JavaScript1.2" type="text/javascript">                        
<!--                                                                            
 var xOfSet=0
 var yOfSet=0
 var bwsr  ="unknown"
  function ttOn(evt,currElem){                                                  
   if (document.layers) { 
    xOfSet=window.pageXOffset
    yOfSet=window.pageYOffset
    bwsr="Netscape6-:"
   } else {
     if (document.all) {
      xOfSet=document.documentElement.scrollLeft
      yOfSet=document.documentElement.scrollTop
      bwsr="IE:"
     } else {
       if (document.getElementById) {
        xOfSet=window.pageXOffset
        yOfSet=window.pageYOffset
        bwsr="Net6:"
       }
     }
   }
   popUpWin = document.getElementById(currElem).style;                       
   if (document.all) {                                                          
    popUpWin.top =parseInt(evt.y)-10+yOfSet;              
    popUpWin.left=Math.max(2,parseInt(evt.x)+10+xOfSet);
   } else {                                                                     
    popUpWin.top =parseInt(evt.pageY)-10+yOfSet;               
    popUpWin.left=Math.max(2,parseInt(evt.pageX)+10+xOfSet);  
   }                                                                            
   popUpWin.visibility = "visible" ;                                      
   popUpWin.display    = "inline"  ;                                      
  }                                                                             
                                                                                
  function ttOff(currElem){                                                     
   popUpWin = document.getElementById(currElem);                                
   popUpWin.style.visibility = "hidden"                                         
   popUpWin.style.display    = "none"                                           
  }                                                                             
//-->                                                                           
</script> 

Reproducible: Always
Steps to Reproduce:
1.
2.See details above
3.

Actual Results:  
The SPAN displays but the position does not change then the SPAN disappears 
when onMouseOut occurs.

Expected Results:  
onMouseOver the SPAN should display and move to the right of the mouse.  
onMouseOut it should disappear.

This causes the web pages to NOT be portable across platforms.
What's the doctype on the page?  To actually be correct CSS, you would need to do:

    popUpWin.top =parseInt(evt.pageY)-10+yOfSet + "px";               
    popUpWin.left=Math.max(2,parseInt(evt.pageX)+10+xOfSet) + "px";  

but we will allow the version you're using in quirks mode....

If you can attach the page in question to this bug using
http://bugzilla.mozilla.org/attachment.cgi?bugid=237997&action=enter that would
help.
I added the "px".  I was unaware that it needed the units.  I assumed it dealt 
with pixels.  I also had to drop the offsets since Mozilla cursor position is 
relative to the page and IE position is relative to the screen.


Thanks fo rthe help
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
Nothing was fixed. The bug report was simply INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → INVALID
I concur it was invalid.  I could not find out from the documentation what the 
proper coding form was.
<http://www.w3.org/TR/2004/CR-CSS21-20040225/syndata.html#length-units>:
> The format of a length value (denoted by <length> in this specification) is a
> <number> (with or without a decimal point) immediately followed by a unit
> identifier (e.g., px, em, etc.). After a zero length, the unit identifier is
> optional.
THank you.
You need to log in before you can comment on or make changes to this bug.