Grow your CSS skills. Land your dream job.

jQuery keypress event is not working in chrome & IE browsers.

  • # May 24, 2013 at 4:42 am

    $(document).keypress(function (e) {
    if( e.ctrlKey && (e.which == 17 || e.which==48) ) {
    $(“nav li a”).css({“font-size”:”16px”,”padding”:”18px 13px 18px 13px”});
    alert(“asdfasdf”);
    }

    else if (e.ctrlKey && (e.which == 17 || e.which==61) ) {

    $(“nav li a”).css({“font-size”:”15px”,”padding”:”18px 12px 18px 12px”});
    }

    else if (e.ctrlKey && (e.which == 17 || e.which==43) ) {

    alert(“ctrl+plus2″);
    }

    else if (e.ctrlKey && (e.which == 17 || e.which==45) ) {

    alert(“ctrl+minus”);
    }

    });

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".