jquery - Why are there no raptors in IE? -
the other day, smashingmagazine gave world wonderful gift. unfortunately ie (at least ie7) shock , amazement, has problem it. know why code below not fire in ie7?
it listens keypresses , fires function if can match konami code. i'm not super knowledgeable on js events, direction appreciated.
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; $(window).bind("keydown.raptorz", function(e){ kkeys.push( e.keycode ); if ( kkeys.tostring().indexof( konami ) >= 0 ) { init(); $(window).unbind('keydown.raptorz'); } }, true);
edit: can else test in ie7 confirm?
jquery supports e.which
keycode in case e.keycode
doesn't work. try change e.keycode
e.which
.
but think true
third argument in bind. take away , try again.
here copy in js fiddle of ie compliant version: link
updated: wow, bind keydown on $(window)
wasn't working ie , $(document.body)
wasn't working ff, did $(document)
, works both....
the link above has version works both ff , ie @ least.
Comments
Post a Comment