摘要:
今天写了个canvas的热点图测试,发觉画笔的点和鼠标的位置不一致,有挺大的偏差。开始还以为是jq中位置函数引用错误,offset和pageX...那几个的属性再看了遍,发觉没什么问题。后来google了下,发觉是html5的canvas问题,这是一个很常见的误区!!在w3网站上是这样解释的:Thecanvaselement has two attributes to control the size of the coordinate space:widthandheight. These attributes, when specified, must have values tha... 阅读全文