To get the position relative to the top-left corner of the document, use the pageX and pageY properties.
To get the position of the mouse pointer relative to the top-left corner of the browser window's client area, use use the clientX and clientY properties.
To get the position relative to the top-left corner of the screen, use the screenX and screenY properties.
pageX/Y gives the coordinates relative to the <html> element in CSS pixels.
clientX/Y gives the coordinates relative to the viewport in CSS pixels.
screenX/Y gives the coordinates relative to the screen in device pixels.
pageX/Y coordinates are relative to the top left corner of the whole rendered page (including parts hidden by scrolling)
clientX/Y coordinates are relative to the top left corner of the visible part of the page, "seen" through browser window.
screenX/Y coordinates are relative to the screen, You'll probably never need them in code
http://help.dottoro.com/ljsqnefp.php
There are some other rare attributes for reference only, you'll probably never need them.
layerX
layerY
offsetX
offsetY
x
y
For instance, x/y: Sets or retrieves the x-coordinate of the mouse pointer relative to the top-left corner of the closest relatively positioned ancestor element of the element that fires the event. But x property always returns the position relative to the top-left corner of the document in Google Chrome and Safari.
In summary, Use clientX/Y in most cases.
Friday, October 13, 2017
Wednesday, October 11, 2017
Domain registrar list
I use GoDaddy to host my domains, but renew price is $19.99 every year, so I am looking for some cheaper alternative for my domains' registrar. Here is the list
namecheap.com
enom.com
hostgator.com
dreamhost.com
name.com
1and1.com
gandi.com
fabulous.com
amazon
I will try to transfer to namecheap.com as its renew price is under $10 for .com domain. As its name indicates, it is pretty cheap comparing to other registrars. They also have promo code available in a monthly update. https://www.namecheap.com/promos/coupons.aspx
Saturday, October 7, 2017
国庆中秋中国之行
2008年9月30号飞美正式开始H1B的漫长工作经历,到2017年,整整9个年头没有在国内过国庆和中秋了。今年刚好赶上双节,就只身回国探亲 (9/26/2017-10/7/2017)。这个季节回国的机票是非常便宜的,而且国航还有圣何塞航线开通周年的优惠。双程的飞机上乘客都比较少,整排大概3-4个人做,幸运的话,可以一人坐几个位置,非常舒服。再加上国航的服务还可以,10多个小时的飞行不是那么累,特别是回程,11个小时,很快就过去了。
此次的目的主要是探亲。2周不到的时间跑了好几个地方,分别是上海,苏州,扬中,常州。上海见了彭医生,带了点礼物。其他地方就是见家人,同学和朋友。除了家人亲戚外,还见了丁同学(在农庄还见到了好多高中同学包括徐同学、戴同学、苏同学、开勇、耿同学、张荣、王坚、陶局),张同学(在长江大酒店,有他的发小冯治国行长、发平同学、程咸),刘同学,海英姐。另外还见到了一些老同事,包括David, Rain, Bryan, Roger, Sophy, 大家在国内过的有滋有味,还跟他们学了掼蛋的扑克牌牌法。也特地去常州见了师兄和师妹,他们刚好假期过来旅游,快1年没有见到他们了,还是比较想念的。因为时间的关系,家人亲戚到没有什么特别的聚会,大多都是微信和简短的寒暄。
中国的变化是月薪日益的。高铁,高速公路,桥梁等基础建设已经把大多数国家甩开很多了;电子支付更是深入人心,无纸张的时代就要到来;通货膨胀也是越来高,房价物价除以汇率后,也深深感到高不可攀。 BAT的互联网3巨头目前的地位还是不可动摇,电子商务,微信,支付宝,度娘,人工智能,凡事想到的领域都有BAT的身影。快递业非常发达,顺丰+N通+菜鸟+京东,覆盖了华夏大地的各个角落,也为电子商务的蓬勃发展提供了基础保障。治安也是非常的好,公共场所都有天眼的监控和严格的安检,在很长的一段时间内,中国肯定不会出现大规模的恐怖袭击,更不要提在美国家常便饭的枪击事件了。
然而泱泱大国在有中国特色的快速经济发展的光环下,也有很多问题。环境、金融、房价、贫富悬殊、复杂的周边形势,都好像是不定时的炸弹。各大媒体不太深入报道这些敏感话题,更多的是名人艺人的花边新闻,媒体好像也思维定势了。沿海城市,低头看城市基础建设,是非常让人佩服的中国速度,但抬头看看那灰蒙蒙的天空,又不得不让人担心中国能够用20年的时间治理好这个日益严重的环境问题嘛?房价已经来到千万人民币的时代,从万元户到千万公寓,也就30年的改革开放时间。北沪深和2线的沿海城市里,有多少房地产创造的千万富翁。强大的政府既保住了房价,也保住了汇率,让世界其他经济体刮目相看。但这个只涨不跌的房地产泡沫究竟会以怎样的形式结局呢?
作为世界的两大经济体,中国和美国各有各的好处。我悲哀的意识到,我和父母永远隔着一个一望无际的太平洋。父母不适应美国,我们不再适应中国。这是每个第一代移民都要付出的代价。我们是回不去了,起码现在,尽管手里还是紧握着中国的护照。
Subscribe to:
Posts (Atom)