Hi Mindstickians!
I'm trying to make a simple app that when a key is pressed on the users keyboard an image appears respective to that letter. I would like to do this for the entire alphabet (a, b, c...)
if a is pressed a.jpg shows up on my page, if r was pressed r.jpg would appear and so on.
I was going to do this with a mega list of if else statements only im sure there must be another way?
var ctrlPressed = false;
$(window).keydown(function(evt) {
if (evt.which == 17) { // ctrl
ctrlPressed = true;
alert('sdf');
}
})
Thanks in advance!
Vijay Shukla
08-Apr-2013AVADHESH PATEL
08-Apr-2013