andrea varnier ha scritto:
try this, supposing #target is yout target

var clickFn = function(){
        alert("ctrl + click");
        $(this).unbind('click', clickFn);
}

$(document)
        .keydown(function(event){
                if (event.keyCode == 17){
                        $("#target").click(clickFn);
                }
        })
        .keyup(function(event){
                if (event.keyCode == 17){
                        $("#target").unbind('click', clickFn);
                }
        });

I was making some test, and I have little problem..

If I bind a function to an element with jquery style method:

$('#target').bind('click', function() { dosomething(this); ) });

in my dosomething function I can retrieve the element clicked.

With your syntax I can bind/unbind function but I can't call dosomething with this parameter.

Sorry, I'm using jquery for awhile, but in javascript I'm very newbie...

Thank you..


--
gianiaz.net - Giovanni Battista Lenoci P.le Bertacchi 66 23100 Sondrio (SO) - Italy

Reply via email to