Monday, October 30, 2017

快递到中国

需要寄东西到中国,慢点没有关系,但要价格便宜。Google了下,发现除了3大巨头FedEx, UPS, USPS外,好像有好多华人开的快递公司。

http://www.chineseinsfbay.com/company/task_category/key_华人快递.html

网上有人推荐如下的
https://rt-express.com/gen/cn/pub_home.php
https://account.us-ex.com/index.aspx
http://lax.aaeexpress.us/Default.aspx
http://www.stoexpress.us/http://sfexpress.shipgce.com/

一个快递网站如果都没有ssl, 我想还是算了吧。建议多试几个,然后找一个可靠的一直用。

打了2个电话,发现这家cupertino的快递离我很近

利达快递-Lida express
4088882332
10793 S.Blaney Ave, Cupertino, CA, 95014
北京食府,三好拉面plaza内,发新社店内

How to hide iFrame

Sometimes we want to hide iframe from UI for different purposes like preload, download file, toggle effect etc. There are couple of ways to hide iFrame.
  • display:none
  • visibility:hidden
  • set height or width to zero
  • set position to offscreen
Here are explanations:
  • I don't suggest use display:none because some browsers like Firefox will skip rendering the iframe into DOM, then all logics/codes will not get executed
  • visibility:hidden will hide the iframe but will occupy the space
  • Set height and width to zero might also need set border to zero using frameBorder
  • Move iframe offscreen is an option I prefer using some class like below
             .offscreen {
                  position: absolute;
                  left: -5000px;
             }

Friday, October 13, 2017

clientX/Y, pageX/Y, screenX/Y etc

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.