(Author: Glen, Senior Engineer of rebate network, once working in EA and other companies)
Recently, I have worked on a project-bucket favorites. Simply put, you can add your favorite images to the bucket page, which uses a lot of iframe, which is summarized as follows:
1. Overlay as a pop-up layer
If you have used the Black Mask to cover the entire page, and the user uses IE6, it is more likely that the page contains the select element, then there is a headache (the principle will not be described here ). We will find that the pop-up DIV cannot cover the select, and our iframe is playing. The logic is as follows:
- Put iframe at the same level as the pop-up div
- Make sure that the z-index of iframe is smaller than the z-index of the bullet layer div.
- Added window resize and scroll events to ensure that iframe can cover the entire page.
Some code
Var iframe = U. isie6 ()? '<Iframe style = "position: absolute; left: 0; top: 0; z-index: 2000000; filter: Alpha (opacity = 0); width: 100%; height: '+ ds. height + '"frameborder =" 0 "> </iframe>':''; $ container. append (iframe ). appendTo ($ body );
2. Cross-origin write cookie
There are two domain names: a.com and B .com. Under some conditions, some functions of B will appear on page. Sometimes you need to perform some operations on B .com domain cookies during page a to facilitate the next access. You only need to add an iframe (dynamic or fixed) to page a. the src attribute points to a proxy page of page B and performs cookie operations on this page.