I would like to use this script as a function :
jQuery(function ($) {
var kkeys = [],
login = '76,79,71,73,78'; //login
$(document).keydown(function (e) {
kkeys.push(e.keyCode);
if (kkeys.toString().indexOf(login) >= 0) {
$(document).unbind('keydown', arguments.callee);
return hs.htmlExpand(this, {
contentId: 'highslide-html-loginform',
wrapperClassName: 'mod_cdlogin',
outlineType: 'rounded-white',
align: 'auto',
anchor: 'auto',
dimmingOpacity: 0,
slideshowGroup: 'mod_cdlogin_loginform'
})
}
});
});
So I could have this code in my js part a call a function in another file, for example codelogin('mycode') and 'mycode' would be 76,79,71,73,78 in that case.
I tried many things but it's not working. The script as itself works fine, but I'm not used to work with jQuery so that might be my problem, I looked for a way to do it but I'm kind of lost. Any help would be appreciated.