Control method and device for pop-up window
By setting the level of the pop -up window carrier than the current operating page and controlling the pop -up content display, the pop -up window is blocked when it is opened and the current operation page displayed in the pop -up window, which enhances the user experience.
Patent Information
- Application Number
- CN201910884924.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-19
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2039-09-19
AI Technical Summary
During the website development process, pop-up windows may be blocked by the current operation page when they are opened, or some current operation pages are displayed in the pop-up window when they are displayed, affecting the user experience.
By setting the hierarchy of the popcop carrier to the level of the current operating page, and control the pop -up content in the pop -up carrier after receiving the instruction of opening the pop -up window, avoid the current operation page cover Hide the current operation page during the window to prevent it from being displayed in the pop -up window.
Effectively avoid the problem of being blocked by the current operation page when the pop -up window is opened, and the part of the current operation page is displayed in the pop -up window when the pop -up window is displayed, which enhances the user's visual experience.
Smart Images

Figure CN112527424B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network technology, and in particular to a control method and device for pop-up windows. Background Art
[0002] During website development, pop-up elements are usually required. However, in some cases, when a pop-up window is opened, the current operation page of the website will cover the pop-up window for a moment. In addition, during the pop-up window display, if the pop-up window cannot completely cover the current operation page, part of the current operation page will be displayed in the pop-up window. Both of the above situations will affect the user's browsing of the content displayed in the pop-up window and reduce the visual experience. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a method and device for controlling a pop-up window, so as to solve or at least partially solve the above technical problems.
[0004] In order to achieve the above-mentioned purpose, an embodiment of the present invention provides a control method for a pop-up window, wherein the pop-up window includes a pop-up window carrier and pop-up window content, the pop-up window carrier is configured to be displayed before the pop-up window is opened and the display content of the pop-up window carrier is empty, the method comprising: in response to receiving an instruction to open a pop-up window, setting the level of the pop-up window carrier to be higher than the level of the current operation page; and controlling the pop-up window content to be displayed in the pop-up window carrier.
[0005] Optionally, the method further includes: in response to receiving an instruction to close the pop-up window, controlling the pop-up window content to stop displaying; and setting the level of the pop-up window carrier to be at least lower than the level of the current operation page.
[0006] Optionally, setting the level of the pop-up window carrier to at least the level of the area of the current operation page includes: setting the value of the level of the pop-up window carrier to a negative value.
[0007] Optionally, the method further includes: after receiving an instruction to open a pop-up window, controlling the current operation page to be hidden; and after receiving an instruction to close the pop-up window, controlling the current operation page to be redisplayed.
[0008] Optionally, the pop-up window carrier is a first iFrame area, and the area of the current operation page is a second iFrame area.
[0009] Optionally, the first iFrame area is configured such that when the displayed content is empty, the height and width of the first iFrame area are consistent with the height and width of the pop-up window.
[0010] Correspondingly, an embodiment of the present invention also provides a control device for pop-up windows, wherein the pop-up window includes a pop-up window carrier and pop-up window content, wherein the pop-up window carrier is configured to be displayed before the pop-up window is opened and the display content of the pop-up window carrier is empty, and the device includes: a first setting module, for setting the level of the pop-up window carrier to be higher than the level of the current operation page in response to receiving an instruction to open the pop-up window; and a first control module, for controlling the pop-up window content to be displayed in the pop-up window carrier.
[0011] Optionally, the device also includes: a second setting module, used to control the pop-up window content to stop displaying in response to receiving an instruction to close the pop-up window; and a second control module, used to set the level of the pop-up window carrier to be at least lower than the level of the current operation page.
[0012] Correspondingly, an embodiment of the present invention further provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above-mentioned control method for pop-up windows.
[0013] Correspondingly, an embodiment of the present invention also provides an electronic device, which includes at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other through the bus; the processor is used to call the program instructions in the memory to execute the above-mentioned control method for pop-up windows.
[0014] Through the above technical solution, the pop-up window carrier and the pop-up window content of the pop-up window are processed separately, wherein the pop-up window carrier is set to be displayed before the pop-up window opening instruction. If an instruction to open the pop-up window is received, the level of the pop-up window carrier is set to be higher than the level of the current operating page, and then the pop-up window content is controlled to be displayed in the pop-up window carrier. In this way, it can be avoided that when the pop-up window is opened, the current operating page will cover the pop-up window for a moment.
[0015] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0017] Figure 1 A schematic flow chart of a method for controlling a pop-up window according to an embodiment of the present invention is shown;
[0018] Figure 2 A schematic flow chart of a method for controlling a pop-up window according to an embodiment of the present invention is shown;
[0019] Figure 3 A schematic diagram showing the current operation page affecting the pop-up window in the prior art is shown;
[0020] Figure 4 A schematic flow chart of a method for controlling a pop-up window according to an embodiment of the present invention is shown;
[0021] Figure 5 A structural block diagram of a control device for pop-up windows according to an embodiment of the present invention is shown;
[0022] Figure 6 A structural block diagram of a control device for pop-up windows according to an embodiment of the present invention is shown; and
[0023] Figure 7 A structural block diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0024] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0025] Figure 1 FIG. 2 is a flow chart showing a method for controlling a pop-up window according to an embodiment of the present invention. Figure 1 As shown, an embodiment of the present invention provides a control method for a pop-up window. The pop-up window of the embodiment of the present invention can be a pop-up window for any website, and the website can be, for example, various types of office platforms, database websites, etc. The pop-up window may include a pop-up window carrier and pop-up window content. The pop-up window carrier is set to be displayed before the pop-up window is opened and the display content of the pop-up window carrier is empty. The pop-up window carrier can be in a display state all the time, for example, it can be set to be displayed as the website interface is opened, and then closed as the website interface is closed.
[0026] The control method for pop-up windows may include steps S110 to S120.
[0027] Step S110, in response to receiving an instruction to open a pop-up window, setting the level of the pop-up window carrier to be higher than the level of the current operation page.
[0028] The instruction for opening a pop-up window may be an instruction generated in response to a user's operation for opening a pop-up window option. For example, a website may have some options for some operation pages, and these options may be presented to the user in the form of a pop-up window.
[0029] Alternatively, the instruction to open the pop-up window may be an instruction generated autonomously by the website. For example, in some cases, the website needs to push information such as instructions for using the website, which can be presented to the user in the form of a pop-up window.
[0030] After receiving the instruction to open the pop-up window, the level of the pop-up window carrier is set to be higher than the level of the current operation page, so as to avoid the influence of the current operation page on the pop-up window display.
[0031] Step S120, controlling the pop-up window content to be displayed in the pop-up window carrier.
[0032] First raise the level of the pop-up carrier and then display the pop-up content to avoid the phenomenon that the current operation page will cover the pop-up for a moment when the pop-up is opened.
[0033] Figure 2 FIG. 2 shows a flow chart of a method for controlling a pop-up window according to another embodiment of the present invention. Figure 2 As shown, based on the above embodiments, the control method for pop-up windows provided by the embodiments of the present invention may further include steps S130 to S140.
[0034] Step S130, in response to receiving an instruction to close the pop-up window, controlling the pop-up window content to stop displaying.
[0035] Corresponding to the instruction for opening the pop-up window, the instruction for closing the pop-up window may be an instruction generated in response to the user's operation on closing the pop-up window option, or the instruction for closing the pop-up window may be an instruction generated autonomously by the website. For example, the website may generate an instruction for closing the pop-up window after the pop-up window content is displayed for a preset time.
[0036] Controlling the content to stop displaying is equivalent to re-controlling the content of the pop-up window carrier to be displayed as empty, but the pop-up window carrier is still displayed.
[0037] Step S140, setting the level of the pop-up window carrier to be at least lower than the level of the current operation page.
[0038] For example, the level value of the pop-up window carrier can be set to a value that is less than the level of the current operation page. In practical applications, the level value can be reflected by the value of Z-index. Optionally, since the level value of the current operation page is generally greater than or equal to 0, the level value of the pop-up window carrier can be set to a negative value, thereby ensuring that the level of the pop-up window carrier is necessarily lower than at least the level of the current operation page.
[0039] Setting the level of the pop-up window carrier to be lower than the level of the current operation page can avoid the pop-up window carrier from affecting the current operation page.
[0040] In an optional embodiment, after receiving an instruction to open a pop-up window, the current operation page can be controlled to be hidden, for example, the current operation page can be closed. This can avoid the phenomenon that "if the pop-up window cannot completely cover the current operation page, part of the current operation page will be seen displayed in the pop-up window." Optionally, the step of controlling the hiding of the current operation page can be executed before the pop-up window content is displayed, for example, it can be executed before, at the same time, or after the step of setting the level of the pop-up window carrier to be higher than the level of the current operation page. In this way, the pop-up window content can be displayed without being affected by the current operation page, reducing the degree of defects in the website interface.
[0041] Based on the above embodiment, if the current operation page is hidden, after receiving the instruction to close the pop-up window, the current operation page can be controlled to be redisplayed, thereby restoring it. This step can be performed before or at the same time as the step of controlling the pop-up window content to stop displaying, or the step of controlling the level of the pop-up window carrier to be lower than the level of the current operation page, and the embodiment of the present invention does not impose any specific restrictions.
[0042] The control method for pop-up windows provided in the embodiment of the present invention can make the website with pop-up window elements have a better interface viewing effect, which is particularly suitable for the case where the area of the currently displayed page is an iFrame area. Figure 3 As shown, after the current pop-up window 320 is opened, a part of the current operation page 310 is displayed in the pop-up window, which affects the pop-up window reading experience. This phenomenon is particularly obvious when using the IE 8 browser.
[0043] In the embodiment of the present invention, the carrier of the pop-up window is preferably an iFrame area, which is set to be displayed when the website interface is opened and then closed when the website interface is closed. For example, the carrier of the pop-up window is the first iFrame area, and the area of the current operation page is the second iFrame area. Figure 4 The control method for pop-up windows provided by the embodiment of the present invention is further described.
[0044] like Figure 4 As shown, in step S410, in response to receiving an instruction to open a pop-up window, the level of the first iFrame area is set to be higher than the level of the second iFrame area. The level of the iFrame area can be set by setting the value of the Z-index of the iFrame area.
[0045] In step S420, the second iFrame area may be controlled to be hidden, for example, the second iFrame area may be closed to avoid its influence on the first iFrame area.
[0046] In step S430, the pop-up window content is controlled to be displayed in the first iFrame area.
[0047] In step S440, in response to receiving an instruction to close the pop-up window, the pop-up window content is controlled to stop displaying.
[0048] In step S450, the second iFrame area is controlled to be redisplayed.
[0049] In step S460, the level of the pop-up window carrier is set to be at least lower than the level of the current operation page.
[0050] Optionally, the first iFrame area may be set such that when the displayed content is empty, the height and width of the first iFrame area may be consistent with the height and width of the pop-up window, so as to avoid adjusting the height and width of the first iFrame area.
[0051] The specific execution principle of each of the above steps can refer to the corresponding description in the previous text, which will not be repeated here. The control method for pop-up windows provided in the embodiment of the present invention can avoid the phenomenon that the iFrame area of the current operation page covers the pop-up window at the moment of opening the pop-up window, and at the same time can avoid the phenomenon that part of the current operation page is displayed in the pop-up window when the pop-up window is displayed, so that the website can present a better viewing effect.
[0052] Figure 5 FIG. 4 shows a structural block diagram of a control device for pop-up windows according to an embodiment of the present invention.
[0053] Figure 5 As shown, an embodiment of the present invention further provides a control device for a pop-up window. The pop-up window of the embodiment of the present invention can be a pop-up window for any website, and the website can be, for example, various types of office platforms, database websites, etc. The pop-up window may include a pop-up window carrier and pop-up window content, and the pop-up window carrier is set to be displayed before the pop-up window is opened and the display content of the pop-up window carrier is empty. The pop-up window carrier can be in a display state all the time, for example, it can be set to be displayed as the website interface is opened, and then closed as the website interface is closed. The device may include: a first setting module 510, which can be used to set the level of the pop-up window carrier to be higher than the level of the current operation page in response to receiving an instruction to open the pop-up window; and a first control module 520, which can be used to control the pop-up window content to be displayed in the pop-up window carrier. Raising the level of the pop-up window carrier first and then displaying the pop-up window content can avoid the phenomenon that the current operation page will cover the pop-up window for a moment when the pop-up window is opened.
[0054] Figure 6 FIG. 4 shows a structural block diagram of a control device for pop-up windows according to an embodiment of the present invention. Figure 6As shown, based on the above embodiment, the control device for pop-up window provided by the embodiment of the present invention may further include: a second setting module 530, which is used to control the pop-up window content to stop displaying in response to receiving an instruction to close the pop-up window; and a second control module 540, which is used to set the level of the pop-up window carrier to be at least lower than the level of the current operation page. The second control module 530 can, for example, set the value of the level of the pop-up window carrier to a negative value, thereby ensuring that the level of the pop-up window carrier is necessarily lower than at least the level of the current operation page.
[0055] In some optional embodiments, the control device for pop-up windows provided in the embodiments of the present invention may further include a third control module and a fourth control module. The third control module may be used to control the hiding of the current operation page after receiving an instruction to open the pop-up window. The third control module may be used to control the redisplay of the current operation page after receiving an instruction to close the pop-up window. This can avoid the phenomenon that part of the current operation page is displayed in the pop-up window when the pop-up window is displayed.
[0056] In some optional embodiments, the pop-up window carrier may be a first iFrame area, and the area of the current operation page may be a second iFrame area. Optionally, the first iFrame area may be set such that when the displayed content is empty, the height and width of the first iFrame area are consistent with the height and width of the pop-up window, so as to avoid adjusting the height and width of the first iFrame area.
[0057] The control device for pop-up windows provided in an embodiment of the present invention can avoid the phenomenon that the iFrame area of the current operating page covers the pop-up window at the moment the pop-up window is opened, and at the same time can avoid the phenomenon that part of the current operating page is displayed in the pop-up window when the pop-up window is displayed, so that the website can present a better viewing effect.
[0058] The control device for pop-up windows may include a processor and a memory. The above-mentioned first setting module, first control module, second setting module, second control module, third control module and fourth control module are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0059] The processor includes a kernel, and the kernel retrieves the corresponding program unit from the memory. One or more kernels may be provided, and the control method for pop-up windows described in any embodiment of the present invention may be implemented by adjusting kernel parameters.
[0060] An embodiment of the present invention further provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the control method for a pop-up window according to any embodiment of the present invention.
[0061] An embodiment of the present invention further provides a processor for running a program, wherein the program, when being run, is used to execute the control method for a pop-up window according to any embodiment of the present invention.
[0062] An embodiment of the present invention provides an electronic device, such as Figure 7 As shown, the electronic device 70 includes at least one processor 701, at least one memory 702 connected to the processor 701, and a bus 703; wherein the processor 701 and the memory 702 communicate with each other through the bus 703; the processor 701 is used to call the program instructions in the memory 702 to execute the control method for pop-up windows according to any embodiment of the present invention. The electronic device can be a server, a PC, a PAD, a mobile phone, etc.
[0063] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: in response to receiving an instruction to open a pop-up window, setting the level of the pop-up window carrier to be higher than the level of the current operating page; controlling the pop-up window content to be displayed in the pop-up window carrier; in response to receiving an instruction to close the pop-up window, controlling the pop-up window content to stop displaying; setting the level of the pop-up window carrier to be at least lower than the level of the current operating page; setting the level of the pop-up window carrier to at least the level of the area of the current operating page includes: setting the value of the level of the pop-up window carrier to a negative value; after receiving an instruction to open a pop-up window, controlling the current operating page to be hidden; after receiving an instruction to close the pop-up window, controlling the current operating page to be redisplayed; the pop-up window carrier is a first iFrame area, and the area of the current operating page is a second iFrame area; the first iFrame area is set so that when the displayed content is empty, the height and width of the first iFrame area are consistent with the height and width of the pop-up window.
[0064] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0065] In a typical configuration, the device includes one or more processors (CPU), memory and bus. The device may also include input / output interface, network interface and the like.
[0066] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
[0067] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0068] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0069] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0070] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A control method for a pop-up window, characterized in that: The pop-up window includes a pop-up window carrier and pop-up window content, the pop-up window carrier is set to be displayed before the pop-up window is opened and the display content of the pop-up window carrier is empty, and the method includes: In response to receiving an instruction to open a pop-up window, setting the level of the pop-up window carrier to be higher than the level of the current operation page; Controlling the pop-up window content to be displayed in the pop-up window carrier; In response to receiving an instruction to close the pop-up window, controlling the pop-up window content to stop displaying; and The level of the pop-up window carrier is set to be at least lower than the level of the current operation page, Among them, the pop-up window carrier is the first iFrame area, and the area of the current operation page is the second iFrame area.
2. The method according to claim 1, characterized in that Setting the level of the pop-up window carrier to at least the level of the area of the current operation page includes: setting the value of the level of the pop-up window carrier to a negative value.
3. The method according to claim 1, characterized in that The method further comprises: After receiving an instruction to open a pop-up window, controlling the current operation page to be hidden; and After receiving an instruction to close the pop-up window, the current operation page is controlled to be redisplayed.
4. The method according to claim 1, characterized in that: The first iFrame area is configured such that when the displayed content is empty, the height and width of the first iFrame area are consistent with the height and width of the pop-up window.
5. A control device for a pop-up window, characterized in that: The pop-up window includes a pop-up window carrier and pop-up window content, the pop-up window carrier is set to be displayed before the pop-up window is opened and the display content of the pop-up window carrier is empty, and the device includes: A first setting module, configured to, in response to receiving an instruction to open a pop-up window, set the level of the pop-up window carrier to be higher than the level of the current operation page; A first control module, used to control the pop-up window content to be displayed in the pop-up window carrier; a second setting module, configured to control the pop-up window content to stop displaying in response to receiving an instruction to close the pop-up window; and The second control module is used to set the level of the pop-up window carrier to be at least lower than the level of the current operation page, Among them, the pop-up window carrier is the first iFrame area, and the area of the current operation page is the second iFrame area.
6. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions, which are used to enable a machine to execute the control method for a pop-up window according to any one of claims 1 to 4.
7. An electronic device, characterized in that: The electronic device includes at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other through the bus; the processor is used to call the program instructions in the memory to execute the control method for pop-up windows according to any one of claims 1-4.
Citation Information
Patent Citations
Web page popup window method and device
CN102194003A
Method, apparatus and computer device for implementing pop-up window in hybrid interface application
CN109063202A
Mini program background fuzzy implementation method and device, electronic equipment and storage medium
CN109800041A