javascript - Jquery - Toggle mousedown event without destroying it in the dom? -


so on friday asked question , wasn't written, let me explain in better detail:

so might sound remedial, have container include mousedown event , want toggle without destroying properties of it.

if :

 $("#div").unbind("mousedown")  // destroy event. 

i thinking move event dom element isn't being used? , switch when i'm done...

so whats happening : have plugin lets call vinny now

  $("#div").vinny(settings); 

vinny has mousedown event want enable/disable via trigger.

i thinking have $fn.disablemousedown function disable it, curious if theirs way unbind mousedown on dom not destroy it?

if know of quick way of doing me out! thanks, vinny

put command inside function, can bind/unbind 1 line only, i.e:

function some() {     // commands }  $("#div").bind("mousedown", some); $("#div").unbind("mousedown"); 

Comments