use js function with parameters as a jQuery callback function

79 views Asked by At

I have a js function with a parammeter:

function dimension(id){
    val = {
    acMaximize : [
        ["#container", "100%", "90%"]
    ],
    acMinimize : [
        ["#container", "70%", "60%"]
    ],
};
var sub = val[id];
var sub1;
for(i in sub){
    sub1 = sub[i];
    $(sub1[0]).css({
        width : sub1[1],
        height : sub1[2]
    });
}
}

And I've tried calling this function in bind method:

$(document).bind("keydown", "Ctrl+A", dimension(id)); // <-- this didn't work.

How could I do this?

//Edit

Just in case of jQuery Hotkeys.

0

There are 0 answers