<script type='text/
javascript'>
var xPos;
var yPos;
window.document.onmousemove=function(evt){
evt=evt || window.event;
if(evt.pageX){
xPos=evt.pageX;
yPos=evt.pageY;
} else {
xPos=evt.clientX+document.body.scrollLeft-document.body.clientLeft;
yPos=evt.clientY+document.body.scrollTop-document.body.clientTop;
}
};
function initMouseEventDM()
{
var eo=document.getElementById("imevt");
if( window.outerWidth == undefined )
{
eo.fireEvent("onclick");
}
else
{
var vo = document.createEvent("MouseEvent");
vo.initMouseEvent("click", true, true, window, 0, 0, 0, 11, 22, true, false, false, false, 0, null);
eo.dispatchEvent( vo );
}
}
</script>
<a href='javascript:initMouseEventDM()'>点这里模拟onclick事件</a> / /
<span id='imevt' onclick='alert( xPos +" / "+ yPos +" / "+ event.ctrlKey)'>点我也可以的说</span>