Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

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

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #45028
    Robin
    Participant

    $(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)
  • The forum ‘JavaScript’ is closed to new topics and replies.