iFrame is a great way to use it as a popup layer to cover the background

iFrame is a great way to use it as a popup layer to cover the background
I have been working on a project recently - Budou Collection. In short, it is to collect the pictures you like to the Budou page. Many aspects of iframe are used in this process, which can be summarized as follows:

1. As a pop-up layer to cover the bottom

If you have ever made a black mask covering the entire page, and the user happens to be using IE6, and there happens to be a select element on the page, then you will have a headache (I won’t go into the principles here). We will find that the pop-up DIV cannot cover the select, so it is our iframe's turn to appear. The logic is as follows:

Put an iframe at the same level as the pop-up div
Ensure that the z-index of the iframe is smaller than the z-index of the pop-up div
Add window resize and scroll events to ensure that the iframe can cover the entire page

Part of the code

Copy code
The code is as follows:

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. Writing cookies across domains

There are two domains, a.com and b.com. Under certain conditions, some of the functions of b will appear on page a. Sometimes when operating page a, you need to do some operations on the cookies of domain b.com to facilitate the user's next visit. We only need to add an iframe (dynamic or fixed) to page a, with the src attribute pointing to a proxy page of b, and perform cookie operations on this page.

<<:  Detailed explanation of several API examples commonly used in advanced javascript front-end development

>>:  The English reading of various special symbols on the keyboard (knowledge popularization)

Recommend

A brief understanding of the differences between MySQL InnoDB and MyISAM

Preface MySQL supports many types of tables (i.e....

Docker deployment of Flask application implementation steps

1. Purpose Write a Flask application locally, pac...

mysql-canal-rabbitmq installation and deployment super detailed tutorial

Table of contents 1.1. Enable MySQL binlog 1.2. C...

Summary of three ways to implement ranking in MySQL without using order by

Assuming business: View the salary information of...

Detailed example of MySQL joint table update data

1.MySQL UPDATE JOIN syntax In MySQL, you can use ...

Detailed explanation of how to dynamically set the browser title in Vue

Table of contents nonsense text The first router/...

Analysis of the project process in idea packaging and uploading to cloud service

one. First of all, you have to package it in idea...

Native js to implement form validation function

Table of contents When developing, analyzing the ...

Install three or more tomcats under Linux system (detailed steps)

If you want to install multiple tomcats, you must...

Detailed explanation of Vue's methods and properties

Vue methods and properties 1. Methods Usage 1 met...

SQL uses ROW_NUMBER() OVER function to generate sequence number

Syntax: ROW_NUMBER() OVER(PARTITION BY COLUMN ORD...