Sleeping_Troll
07-22-2009, 01:29 AM
Can anyone give me an example of proper syntax for the pointerX and PointerY methods with an event observer in prototype framework?
I am trying to reposition an image to center on the cursor on a mouseover event... this is the site http://orbzorbz.com
This is the code I have...
function observerover(i){
Orb[i].Img.observe('mouseover', function(event){
Orb[i].Static=1;
this.style.zIndex=5000;
this.style.width=300+'px';
this.style.height=300+'px';
this.style.left=this.pointerX(event)-150+"px";
this.style.top=this.pointerY(event)-150+"px";
while($('panelMain').down()){
$('panelMain').down().remove();
}
$('panelMain').insert(Orb[i].Panel);
});
}
I am trying to reposition an image to center on the cursor on a mouseover event... this is the site http://orbzorbz.com
This is the code I have...
function observerover(i){
Orb[i].Img.observe('mouseover', function(event){
Orb[i].Static=1;
this.style.zIndex=5000;
this.style.width=300+'px';
this.style.height=300+'px';
this.style.left=this.pointerX(event)-150+"px";
this.style.top=this.pointerY(event)-150+"px";
while($('panelMain').down()){
$('panelMain').down().remove();
}
$('panelMain').insert(Orb[i].Panel);
});
}