how to clear the 'double right click ' on google-map-v3..

Posted by zjm1126 on Stack Overflow See other posts from Stack Overflow or by zjm1126
Published on 2010-04-02T08:13:29Z Indexed on 2010/04/02 8:43 UTC
Read the original article Hit count: 246

this is my code, and I can't remove the mousedown eventlistener :

//***********  double right click ********/

var c =0 ;
function time(event){
  if(event.button == 2){
    c++;
    setTimeout(cc, 600);
  }
 if (c >1){
     alert('ok i get it')
  }
}
//$('#map_canvas')[0].mousedown(time);
$('#map_canvas')[0].addEventListener('mousedown', time, false);
//$("map_canvas").unbind() 
//$('map_canvas')[0].onmousedown=function(){};//this can't be clear the event
$('map_canvas')[0].removeEventListener('mousedown', time, false);

function cc(){
  c=0;
}
//***********  double right click ********/

© Stack Overflow or respective owner

Related posts about google-maps

Related posts about google-maps-v3