what im doing is when i click a link, it will trigger an keypress.
For example, when I click a link, it will actually do ctrl + = which is keycode 17 and 187 together. I have try but no luck,unsuccessful.
var press = jQuery.Event("keydown");
press.ctrlKey = true;
press.which = 187;
$("#resize").click(function(e){
e.trigger(press);
e.preventDefault();
});
or anyone have a better way to do this ??
thanks
Triggering an event on an event will never work 😉 Use a selector instead:
demo
Update
Since the questioner has become a bit more precise. I’ve made this demo
This would be enough for his needs: demo