Tuesday, February 14, 2012

REMOVE WARNING : event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.


Use the following code:
jQuery(function(){
    // remove layerX and layerY
    var all = jQuery.event.props,
        len = all.length,
        res = [];
    while (len--) {
      var el = all[len];
      if (el != 'layerX' && el != 'layerY') res.push(el);
    }
    jQuery.event.props = res;
}());

2 comments:

  1. Hi Lucky,

    Care to share with us where to put this string of code?

    Thanks!

    ReplyDelete
    Replies
    1. you can put this code in footer or header file

      Delete