插件的代码是(我使用这个脚本 - http://www.tanabi.com/js/jquery.imagemap.js):脚本不要在FF工作
if(typeof ev.originalTarget.actualPosX == 'undefined'){
jQuery.imagemap.ffGetPosition(ev.originalTarget);
}
我在Firefox上的错误 - ev.originalTarget未定义,在86线
和我的代码:
jQuery.fn.imagecoords = function() {
return this.each(function(){
jQuery(this).click(function(ev){
//var coords;
var x = jQuery.imagemap.getEventX(ev);
var y = jQuery.imagemap.getEventY(ev);
jQuery('#x').val(x+4);
jQuery('#y').val(y+2);
jQuery('#new_point').remove();
jQuery('#map').append('<a href="javascript:void(0)" id="new_point" class="bullet" rel="' + x + '-' + y + '" style="left: ' + x + 'px; top: ' + y + 'px; display: block; "> </a>');
return 0;
});
});
};
它对我有帮助吗?我认为当Firefox无法将未定义的类型转换为需要的类型时显示错误...或者不是? – inlanger 2011-04-28 06:36:45
你可以给我更多的细节或代码在你的问题?它会帮助我解决你的问题。 – YNhat 2011-04-28 06:48:24
我编辑问题... – inlanger 2011-04-28 07:23:07