Jump to content
php.lv forumi

Recommended Posts

Posted (edited)

Hi.

 

tipa eventi nestrādā uz FF ? :o :unsure:

 

onclick="doSomething();"

function doSomething(e) {
  var isSet = ( typeof(e) != "undefined" );
  alert(isSet);
}

Edited by Delfins
Posted

A bet loģiski. Vajag taču šitā:

onclick="doSomething(this);"

function doSomething(e) {
 var isSet = ( typeof(e) != "undefined" );
 alert(isSet);
}

Posted (edited)

Final result:

 

IE_6 / FF_1.0.7 / Opera_8.5

 

function handleImageClick(e) {
   var posx = 0;
   var posy = 0;
   if ( typeof(e) == "undefined" ) var e = window.event;
   if ( typeof(opera) != "undefined" || typeof(document.all) != "undefined" ) {
       posx = e.offsetX;
       posy = e.offsetY;
   } else {
       posx = e.pageX - this.x;
       posy = e.pageY - this.y;
   }
}

Edited by Delfins
×
×
  • Create New...