Summary of the invention
Fundamental purpose of the present invention is to provide a kind of webpage to eject and confines method for position and device, when solving in correlation technique that Microsoft Silverlight web interface generation visibility region changes, easily there is the problem of the some or all of situation about being blocked of pop-up box.
To achieve these goals, according to an aspect of the present invention, provide a kind of webpage to eject and confined method for position.The method comprises: detect webpage pop-up box residing position on web interface; According to the pop-up box relative position that pop-up box and web interface are adjusted in residing position on web interface so that pop-up box is positioned at the visibility region of web interface all the time.
Further, according to pop-up box residing position on web interface, adjusting the relative position of pop-up box and web interface so that before pop-up box is positioned at the visibility region of web interface all the time, method also comprises: whether the visibility region that detects web interface changes, wherein, if detect the visibility region of web interface, change, adjust the relative position of pop-up box and web interface.
Further, if changed in the visibility region that detects web interface, before adjusting the relative position of pop-up box and web interface, method also comprises: judge whether pop-up box is all presented in the visibility region of web interface, wherein, if judge pop-up box, be not all presented in the visibility region of web interface, adjust the relative position of pop-up box and web interface.
Further, judging whether pop-up box is all presented in the visibility region of web interface comprises: whether the upper left corner that judges pop-up box is presented in the visibility region of web interface; And/or whether the lower right corner that judges pop-up box is presented in the visibility region of web interface, wherein, pop-up box is rectangle pop-up box, if judging pop-up box is not all presented in the visibility region of web interface, the relative position of adjusting pop-up box and web interface comprises: if judged in the upper left corner of pop-up box and/or visibility region that the lower right corner is not presented at web interface, obtain the size of the visibility region of web interface; Obtain the size of pop-up box actual displayed; Obtain the old position of pop-up box; And according to the old position of the size of the size of the visibility region of web interface and pop-up box actual displayed and pop-up box, determine the reposition of pop-up box.
Further, the size of obtaining the visibility region of web interface comprises: the height that obtains the length of visibility region and the visibility region of web interface of web interface.The size of obtaining pop-up box actual displayed comprises: the height that obtains length and the pop-up box actual displayed of pop-up box actual displayed, the old position that obtains pop-up box comprises: the old coordinate in the upper left corner and/or the old coordinate in the lower right corner that obtain pop-up box, according to the old position of the size of the size of the visibility region of web interface and pop-up box actual displayed and pop-up box, the reposition of determining pop-up box comprises: according to the length of the height of the visibility region of the length of the visibility region of web interface and web interface and pop-up box actual displayed and the old coordinate in the height of pop-up box actual displayed and the upper left corner of pop-up box and/or the old coordinate in the lower right corner, determine the new coordinate in the upper left corner and/or the new coordinate in the lower right corner of pop-up box, wherein, the new coordinate in the upper left corner of pop-up box calculates by following formula: the length of old coordinate-pop-up box actual displayed in the upper left corner of the length-pop-up box of the visibility region of the new coordinate=web interface in the upper left corner of pop-up box, the height of old coordinate-pop-up box actual displayed in the upper left corner of the height-pop-up box of the visibility region of the new coordinate=web interface in the upper left corner of pop-up box.
Further, obtain the length of pop-up box actual displayed and the height of pop-up box actual displayed comprises: the upper left corner coordinate that obtains the first sub-pop-up box; Obtain the upper left corner coordinate of the second sub-pop-up box, wherein, the first sub-pop-up box and the second sub-pop-up box are separately positioned on the upper left corner of pop-up box and the lower right corner of pop-up box, and the size of the first sub-pop-up box and the second sub-pop-up box is 0px; According to the upper left corner coordinate of the upper left corner coordinate of the first sub-pop-up box and the second sub-pop-up box, determine the height of length and the pop-up box actual displayed of pop-up box actual displayed, wherein, the height of the length of pop-up box actual displayed and pop-up box actual displayed calculates by following formula: the upper left corner coordinate of the sub-pop-up box of upper left corner coordinate-the first of the sub-pop-up box of length=the second of pop-up box actual displayed, the upper left corner coordinate of the sub-pop-up box of upper left corner coordinate-the first of the sub-pop-up box of height=the second of pop-up box actual displayed.
To achieve these goals, according to a further aspect in the invention, provide a kind of webpage to eject and confined a device.This device comprises: the first detecting unit, for detection of webpage pop-up box residing position on web interface; Adjustment unit, for according to the pop-up box relative position that pop-up box and web interface are adjusted in residing position on web interface so that pop-up box is positioned at the visibility region of web interface all the time.
Further, webpage ejects to be confined a device and also comprises: whether the second detecting unit, change for detection of the visibility region of web interface, wherein, if adjustment unit also changes for detecting the visibility region of web interface, adjust the relative position of pop-up box and web interface.
Further, webpage ejection is confined a device and is also comprised: judging unit, for judging whether pop-up box is all presented in the visibility region of web interface, wherein, if adjustment unit is not also all presented in the visibility region of web interface for judging pop-up box, adjust the relative position of pop-up box and web interface.
Further, judging unit comprises: the first judge module, for judging whether the upper left corner of pop-up box is presented in the visibility region of web interface; And/or second judge module, for judging whether the lower right corner of pop-up box is presented in the visibility region of web interface, wherein, pop-up box is rectangle pop-up box.Adjustment unit comprises: the first acquisition module, if for judging in the upper left corner of pop-up box and/or visibility region that the lower right corner is not presented at web interface, obtain the size of the visibility region of web interface; The second acquisition module, for obtaining the size of pop-up box actual displayed; The 3rd acquisition module, for obtaining the old position of pop-up box; And determination module, for according to the old position of the size of the size of the visibility region of web interface and pop-up box actual displayed and pop-up box, determine the reposition of pop-up box.
Further, the first acquisition module is also for obtaining the height of the length of visibility region and the visibility region of web interface of web interface, the second acquisition module is also for obtaining the height of length and the pop-up box actual displayed of pop-up box actual displayed, the 3rd acquisition module is also for obtaining the old coordinate in the upper left corner and/or the old coordinate in the lower right corner of pop-up box, determination module is also for according to the length of the height of the visibility region of the length of the visibility region of web interface and web interface and pop-up box actual displayed and the old coordinate in the height of pop-up box actual displayed and the upper left corner of pop-up box and/or the old coordinate in the lower right corner, determine the new coordinate in the upper left corner and/or the new coordinate in the lower right corner of pop-up box, wherein, the new coordinate in the upper left corner of pop-up box calculates by following formula: the length of old coordinate-pop-up box actual displayed in the upper left corner of the length-pop-up box of the visibility region of the new coordinate=web interface in the upper left corner of pop-up box, the height of old coordinate-pop-up box actual displayed in the upper left corner of the height-pop-up box of the visibility region of the new coordinate=web interface in the upper left corner of pop-up box.
Further, the second acquisition module comprises: first obtains submodule, for obtaining the upper left corner coordinate of the first sub-pop-up box; Second obtains submodule, for obtaining the upper left corner coordinate of the second sub-pop-up box, wherein, the first sub-pop-up box and the second sub-pop-up box are separately positioned on the upper left corner of pop-up box and the lower right corner of pop-up box, and the size of the first sub-pop-up box and the second sub-pop-up box is 0px; Determine submodule, be used for according to the upper left corner coordinate of the upper left corner coordinate of the first sub-pop-up box and the second sub-pop-up box, determine the height of length and the pop-up box actual displayed of pop-up box actual displayed, wherein, the height of the length of pop-up box actual displayed and pop-up box actual displayed calculates by following formula: the upper left corner coordinate of the sub-pop-up box of upper left corner coordinate-the first of the sub-pop-up box of length=the second of pop-up box actual displayed, the upper left corner coordinate of the sub-pop-up box of upper left corner coordinate-the first of the sub-pop-up box of height=the second of pop-up box actual displayed.
By the present invention, adopt and detect webpage pop-up box residing position on web interface; And according to the pop-up box relative position that pop-up box and web interface are adjusted in residing position on web interface so that pop-up box is positioned at the visibility region of web interface all the time, when having solved in correlation technique Microsoft Silverlight web interface generation visibility region and having changed, easily there is the problem of the some or all of situation about being blocked of pop-up box, and then reached the effect that pop-up box is presented at the visibility region of web interface all the time.
Embodiment
It should be noted that, in the situation that not conflicting, embodiment and the feature in embodiment in the application can combine mutually.Describe below with reference to the accompanying drawings and in conjunction with the embodiments the present invention in detail.
In order to make those skilled in the art better understand the present invention program, below in conjunction with the accompanying drawing in the embodiment of the present invention, to being clearly and completely described in the embodiment of the present invention, obviously, described embodiment is only the embodiment of a part of the present invention, rather than whole embodiment.Embodiment based in the present invention, does not make the every other embodiment obtaining under creative work prerequisite those of ordinary skills, all should belong to protection scope of the present invention.
It should be noted that, the term " first " in instructions of the present invention and claims and above-mentioned accompanying drawing, " second " etc. are for distinguishing similar object, and needn't be for describing specific order or precedence.The data that should be appreciated that such use suitably can exchanged in situation, so as embodiments of the invention described herein can with except diagram here or describe those order enforcement.In addition, term " comprises " and " having " and their any distortion, is intended to be to cover not exclusive comprising.
According to embodiments of the invention, provide a kind of webpage to eject and confined method for position, this webpage eject confine method for position for adjust pop-up box and web interface relative position so that pop-up box be presented at all the time in the visibility region of web interface.This webpage ejection is confined method for position and be may operate on computer-processing equipment.
Fig. 2 ejects according to the webpage of first embodiment of the invention the process flow diagram of confining method for position.
As shown in Figure 2, the method comprises that following step S101 is to step S102:
Step S101, detects webpage pop-up box residing position on web interface.
It should be noted that, in embodiments of the present invention, detecting webpage pop-up box residing position on web interface can be to detect pop-up box residing position on Microsoft Silverlight interface, Microsoft Silverlight interface.Pop-up box residing position on web interface can be the physical location of pop-up box on web interface, preferably, pop-up box residing position on web interface can be the position of pop-up box actual displayed on web interface, like this, detect the position of pop-up box actual displayed on web interface and can judge the visibility region whether pop-up box is presented at web interface, improved the effect of the accuracy of detection efficiency and judgement.
Step S102, according to the pop-up box relative position that pop-up box and web interface are adjusted in residing position on web interface so that pop-up box is positioned at the visibility region of web interface all the time.
In embodiments of the present invention, according to pop-up box residing position on web interface, adjust the relative position of pop-up box and web interface so that pop-up box is positioned at the visibility region of web interface all the time can be that the relative position of adjustment pop-up box and web interface is so that pop-up box is positioned at the visibility region of web interface all the time, wherein, pop-up box can be positioned at the fixed position of the visibility region of web interface all the time, or can be positioned at all the time the optional position of the visibility region of web interface.
For example, in embodiments of the present invention, when webpage pop-up box residing position as shown in Figure 1 time on web interface being detected, can be according to the pop-up box relative position that pop-up box and web interface are adjusted in residing position on web interface so that pop-up box be positioned at the visibility region of web interface all the time, be about to pop-up box navigate to 5 shown in Fig. 3 position so that pop-up box be all presented in the visibility region 3 of web interface, wherein, arrow represents the integrated moving direction of pop-up box.
Pass through the embodiment of the present invention, adopt constantly detect webpage pop-up box on web interface residing position and according to the pop-up box relative position that pop-up box and web interface are adjusted in residing position on web interface so that pop-up box is positioned at the visibility region of web interface all the time, like this, avoided when horizontal scroll bar or longitudinally scroll bar roll, when the visibility region of web interface can change, original pop-up box that is all presented at web interface visibility region may be because of the variation of visibility region by some or all of problem of blocking, reached the effect in the visibility region that keeps pop-up box to be presented at all the time web interface.
Fig. 4 ejects according to the webpage of second embodiment of the invention the process flow diagram of confining method for position.
As shown in Figure 4, this webpage ejection is confined method for position and is comprised that following step S201 is to step S203, and this embodiment can be used as preferred implementation embodiment illustrated in fig. 2.
Step S201, the step S101 with embodiment illustrated in fig. 2, does not repeat them here.
Step S202, whether the visibility region that detects web interface changes.
In embodiments of the present invention, the relative position of adjusting pop-up box and web interface according to pop-up box residing position on web interface can comprise whether the visibility region that detects web interface changes so that pop-up box is positioned at the visibility region of web interface all the time.When detecting the visibility region of web interface and change, perform step S203, that is, adjust the relative position of pop-up box and web interface, otherwise when detecting the visibility region of web interface and do not change, perform step S201.
Step S203, the relative position of adjustment pop-up box and web interface.
In embodiments of the present invention, the relative position of adjusting pop-up box and web interface can be the relative position of adjusting the visibility region of pop-up box and web interface, particularly, when the visibility region of web interface being detected and change, the position that can adjust pop-up box is positioned at the relatively-stationary position of the visibility region of web interface all the time, for example, the position that can adjust pop-up box is positioned at the lower right corner of the visibility region of web interface all the time, or the position that can adjust pop-up box is positioned at the optional position of the visibility region of web interface all the time.
Pass through the embodiment of the present invention, whether the visibility region that adopt to detect web interface changes and when detecting the visibility region of web interface and change, adjust the relative position of pop-up box and web interface, like this, while having avoided the visibility region of web interface not change, also detect the situation of webpage pop-up box residing position on web interface, reduced the frequency detecting, improve detection efficiency, and then reached the effect in the visibility region that keeps pop-up box to be presented at all the time web interface.
Fig. 5 ejects according to the webpage of third embodiment of the invention the process flow diagram of confining method for position.
As shown in Figure 5, this webpage ejection is confined method for position and is comprised that following step S301 is to step S304, and this embodiment can be used as preferred implementation embodiment illustrated in fig. 4.
Step S301 and step S302, with step S201 embodiment illustrated in fig. 4 and step S202, do not repeat them here respectively.
Step S303, judges whether pop-up box is all presented in the visibility region of web interface.
When horizontal or longitudinal scroll bar of web interface occurs to roll, the visibility region of web interface changes, at this moment, the ejection window that was originally positioned at web interface may all be presented at the visibility region of web interface, or may partly or entirely be blocked, in embodiments of the present invention, if detecting the visibility region of web interface changes, the relative position of adjusting pop-up box and web interface can comprise and judges whether pop-up box is all presented in the visibility region of web interface, in the time of in the visibility region of judging pop-up box and be all presented at web interface, execution step S301, otherwise be not all presented in the visibility region of web interface when judging pop-up box, when to be that pop-up box is some or all of be blocked, execution step S304.
In the invention process example, while supposing that pop-up box is set in advance in the lower right corner of visibility region of web interface, can judge in the following manner whether pop-up box is all presented in the visibility region of web interface:
When horizontal or longitudinal scroll bar of web interface all rolls, can judge that the upper left corner of pop-up box and the visibility region whether lower right corner is presented at web interface are interior to judge whether pop-up box is all presented in the visibility region of web interface, wherein, in the time of in judging the upper left corner of pop-up box and visibility region that the lower right corner is not presented at web interface, confirm that pop-up box is not all presented in the visibility region of web interface; Or when the horizontal scroll bar of web interface occurs to roll, whether the lower right corner that can judge pop-up box is presented in the visibility region of web interface to judge whether pop-up box is all presented in the visibility region of web interface or judges whether the upper left corner of pop-up box is presented in the visibility region of web interface, wherein, in the time of in the visibility region of judging the lower right corner of pop-up box and be not presented at web interface, confirm that pop-up box is not all presented in the visibility region of web interface; Or when longitudinal scroll bar of web interface occurs to roll, whether the upper left corner that can judge pop-up box is presented in the visibility region of web interface to judge whether pop-up box is all presented in the visibility region of web interface, wherein, in the time of in the visibility region of judging the upper left corner of pop-up box and be not presented at web interface, confirm that pop-up box is not all presented in the visibility region of web interface, it should be noted that, pop-up box is rectangle pop-up box.
Step S304, the relative position of adjustment pop-up box and web interface.
In embodiments of the present invention, suppose that pop-up box is set in advance in the lower right corner of the visibility region of web interface, if judge pop-up box, be not all presented in the visibility region of web interface, can adjust by following steps the relative position of pop-up box and web interface:
Step 1, if judged in the upper left corner of pop-up box or visibility region that the lower right corner is not presented at web interface, obtain the size of the visibility region of web interface, wherein, the size of the visibility region of web interface is the size of the visibility region actual displayed of web interface, and the size of obtaining the visibility region of web interface can be to obtain the height of the length of visibility region and the visibility region of web interface of web interface.
Step 2, obtains the size of pop-up box actual displayed on web interface, and wherein, the size of obtaining pop-up box actual displayed on web interface can be for obtaining the height of length and the pop-up box actual displayed of pop-up box actual displayed.
Particularly, can obtain in the following manner the height of length and the pop-up box actual displayed of pop-up box actual displayed: the upper left corner coordinate and the upper left corner coordinate that obtains the second sub-pop-up box that obtain the first sub-pop-up box, wherein, the first sub-pop-up box and the second sub-pop-up box are separately positioned on the upper left corner of pop-up box and the lower right corner of pop-up box, and the size of the first sub-pop-up box and the second sub-pop-up box is 0px; According to the upper left corner coordinate of the upper left corner coordinate of the first sub-pop-up box and the second sub-pop-up box, determine the height of length and the pop-up box actual displayed of pop-up box actual displayed, wherein, the height of the length of pop-up box actual displayed and pop-up box actual displayed calculates by following formula:
The upper left corner horizontal ordinate of the sub-pop-up box of upper left corner horizontal ordinate-the first of the sub-pop-up box of length=the second of pop-up box actual displayed,
The upper left corner ordinate of the sub-pop-up box of upper left corner ordinate-the first of the sub-pop-up box of height=the second of pop-up box actual displayed.
For example, as shown in Figure 6, the first sub-pop-up box is arranged on the upper left corner of pop-up box, and the second sub-pop-up box is arranged on the lower right corner of pop-up box, supposes that the coordinate in the upper left corner of the first sub-pop-up box of obtaining is (X
1, Y
1), the coordinate in the upper left corner of the second sub-pop-up box obtaining is (X
2, Y
2), can determine the length a of pop-up box actual displayed
1=X
2-X
1, the height h of pop-up box actual displayed
1=Y
2-Y
1.
Step 3, the old position that obtains pop-up box, obtains the position of pop-up box before the visibility region of web interface changes, and wherein, the old position that obtains pop-up box can obtain the old coordinate in the upper left corner and/or the old coordinate in the lower right corner of pop-up box.
Step 4, according to the reposition of the old location positioning pop-up box of the size of the size of the visibility region of web interface and pop-up box actual displayed and pop-up box, wherein, the reposition of pop-up box refers to that pop-up box is all presented at the position of the visibility region of web interface again, in embodiments of the present invention, can determine according to the length of the height of the visibility region of the length of the visibility region of web interface and web interface and pop-up box actual displayed and the old coordinate in the height of pop-up box actual displayed and the upper left corner of pop-up box and/or the old coordinate in the lower right corner the new coordinate in the upper left corner and/or the new coordinate in the lower right corner of pop-up box, wherein, the new coordinate in the upper left corner of pop-up box calculates by following formula:
The length of old horizontal ordinate-pop-up box actual displayed in the upper left corner of the length-pop-up box of the visibility region of the new horizontal ordinate=web interface in the upper left corner of pop-up box,
The height of old ordinate-pop-up box actual displayed in the upper left corner of the height-pop-up box of the visibility region of the new ordinate=web interface in the upper left corner of pop-up box.
For example, as shown in Figure 7, suppose the length a of the pop-up box actual displayed obtained
1, the length h of the pop-up box actual displayed of obtaining
1, the length a of the visibility region of the web interface obtaining
2, the length h of the visibility region of the web interface obtaining
2, the old coordinate in the upper left corner of the pop-up box obtaining is (X
3, Y
3), determine that the old coordinate in the upper left corner of pop-up box is (X
4, Y
4), wherein, X
4=a
2-X
3-a
1, Y
4=h
2-Y
3-h
1.Like this, by determining that the new coordinate in the upper left corner of pop-up box can determine that pop-up box is presented at the position of the visibility region at page interface completely.
According to embodiments of the invention, provide a kind of webpage to eject and confined a device, this webpage eject confine a device for adjust pop-up box and web interface relative position so that pop-up box be presented at all the time in the visibility region of web interface.It should be noted that, the pick-up unit that the detection method that the daily record that the embodiment of the present invention provides generates can generate by the daily record of the embodiment of the present invention is carried out, the detection method that the pick-up unit that the daily record of the embodiment of the present invention generates also can generate for carrying out the daily record of the embodiment of the present invention.
Fig. 8 ejects according to the webpage of first embodiment of the invention the schematic diagram of confining a device.
As shown in Figure 8, this device comprises: the first detecting unit 10 and adjustment unit 20.
The first detecting unit 10 is for detection of webpage pop-up box residing position on web interface.It should be noted that, in embodiments of the present invention, the first detecting unit 10 can detect Microsoft Silverlight interface pop-up box residing position on Microsoft Silverlight interface.Pop-up box residing position on web interface can be the physical location of pop-up box on web interface, preferably, pop-up box residing position on web interface can be the position of pop-up box actual displayed on web interface, like this, detect the position of pop-up box actual displayed on web interface and can judge the visibility region whether pop-up box is presented at web interface, improved the effect of the accuracy of detection efficiency and judgement.
Adjustment unit 20 for according to the pop-up box relative position that pop-up box and web interface are adjusted in residing position on web interface so that pop-up box is positioned at the visibility region of web interface all the time.In embodiments of the present invention, adjustment unit 20 can be to adjust the relative position of pop-up box and web interface so that pop-up box is positioned at the visibility region of web interface all the time, wherein, pop-up box can be positioned at the fixed position of the visibility region of web interface all the time, or can be positioned at all the time the optional position of the visibility region of web interface.
Pass through the embodiment of the present invention, adopt the first detecting unit 10 constantly to detect webpage pop-up box residing position on web interface, and adopt adjustment unit 20 according to the pop-up box relative position that pop-up box and web interface are adjusted in residing position on web interface so that pop-up box is positioned at the visibility region of web interface all the time, like this, avoided when horizontal scroll bar or longitudinally scroll bar roll, when the visibility region of web interface can change, original pop-up box that is all presented at web interface visibility region may be because of the variation of visibility region by some or all of problem of blocking, reached the effect in the visibility region that keeps pop-up box to be presented at all the time web interface.
Fig. 9 ejects according to the webpage of second embodiment of the invention the schematic diagram of confining a device.
As shown in Figure 9, this embodiment can be used as preferred implementation embodiment illustrated in fig. 8, and the webpage of this embodiment ejects and confines a device except comprising the first detecting unit 10 and adjustment unit 20 of the first embodiment, also comprises the second detecting unit 30.
Identical with the first embodiment of the effect of the first detecting unit 10, does not repeat them here.
Whether the second detecting unit 30 changes for detection of the visibility region of web interface.In embodiments of the present invention, the relative position of adjusting pop-up box and web interface according to pop-up box residing position on web interface can comprise whether the visibility region that detects web interface changes so that pop-up box is positioned at the visibility region of web interface all the time.When detecting the visibility region of web interface and change, adjust the relative position of pop-up box and web interface, otherwise when detecting the visibility region of web interface and do not change, do not deal with.
In embodiments of the present invention, adjustment unit 20 is also for adjusting the relative position of pop-up box and web interface.Adjustment unit 20 can be adjusted the relative position of the visibility region of pop-up box and web interface, particularly, when the visibility region of web interface being detected and change, the position that adjustment unit 20 can be adjusted pop-up box is positioned at the relatively-stationary position of the visibility region of web interface all the time, for example, the position that adjustment unit 20 can be adjusted pop-up box is positioned at the lower right corner of the visibility region of web interface all the time, or adjustment unit 20 position that can adjust pop-up box is positioned at the optional position of the visibility region of web interface all the time.
Pass through the embodiment of the present invention, whether the visibility region that adopts the second detecting unit 30 to detect web interfaces changes and when detecting the visibility region of web interface and change, adjustment unit 20 is adjusted the relative position of pop-up box and web interface, like this, while having avoided the visibility region of web interface not change, also detect the situation of webpage pop-up box residing position on web interface, reduced the frequency detecting, improve detection efficiency, and then reached the effect in the visibility region that keeps pop-up box to be presented at all the time web interface.
Figure 10 ejects according to the webpage of third embodiment of the invention the schematic diagram of confining a device.
As shown in figure 10, this embodiment can be used as preferred implementation embodiment illustrated in fig. 9, the webpage of this embodiment ejects and confines a device except the first detecting unit 10, adjustment unit 20 and the second detecting unit 30 that comprise the second embodiment, also comprises judging unit 40.
Identical with the second embodiment of the effect of the first detecting unit 10, the second detecting unit 30 and adjustment unit 20, does not repeat them here.
Judging unit 40 is for judging whether pop-up box is all presented in the visibility region of web interface.When horizontal or longitudinal scroll bar of web interface occurs to roll, the visibility region of web interface changes, at this moment, the ejection window that was originally positioned at web interface may all be presented at the visibility region of web interface, or may partly or entirely be blocked, in embodiments of the present invention, in the time of in judging unit 40 is judged the visibility region that pop-up box is all presented at web interface, be left intact, otherwise when judging unit 40, judging pop-up box is not all presented in the visibility region of web interface, when to be that pop-up box is some or all of be blocked, adjustment unit 20 is adjusted the relative position of pop-up box and web interface.
Figure 11 ejects according to the webpage of fourth embodiment of the invention the schematic diagram of confining a device.
As shown in figure 11, this embodiment can be used as preferred implementation embodiment illustrated in fig. 10, the webpage of this embodiment ejects confines the first detecting unit 10, adjustment unit 20, the second detecting unit 30 and the judging unit 40 that a device comprises the second embodiment, wherein, judging unit 40 comprises the first judge module 401 and the second judge module 402, and adjustment unit 20 comprises the first acquisition module 201, the second acquisition module 202, the 3rd acquisition module 203 and determination module 204.
Identical with the second embodiment of the effect of the first detecting unit 10 and the second detecting unit 30, does not repeat them here.
The first judge module 401 is for judging whether the upper left corner of pop-up box is presented in the visibility region of web interface.The second judge module 402 is for judging whether the lower right corner of pop-up box is presented in the visibility region of web interface, and wherein, pop-up box is rectangle pop-up box.In the invention process example, while supposing that pop-up box is set in advance in the lower right corner of visibility region of web interface, the first judge module 401 and the second judge module 402 can judge whether pop-up box is all presented in the visibility region of web interface in the following manner:
When horizontal or longitudinal scroll bar of web interface all rolls, the first judge module 401 and the second judge module 402 can judge in the upper left corner of pop-up box and visibility region that whether lower right corner is presented at web interface to judge whether pop-up box is all presented in the visibility region of web interface, wherein, in the time of in judging the upper left corner of pop-up box and visibility region that the lower right corner is not presented at web interface, confirm that pop-up box is not all presented in the visibility region of web interface; Or when the horizontal scroll bar of web interface occurs to roll, the second judge module 402 can judge whether the lower right corner of pop-up box is presented in the visibility region of web interface to judge whether pop-up box is all presented in the visibility region of web interface or judges whether the upper left corner of pop-up box is presented in the visibility region of web interface, wherein, in the time of in the visibility region of judging the lower right corner of pop-up box and be not presented at web interface, confirm that pop-up box is not all presented in the visibility region of web interface; Or when longitudinal scroll bar of web interface occurs to roll, the first judge module 401 can judge whether the upper left corner of pop-up box is presented in the visibility region of web interface to judge whether pop-up box is all presented in the visibility region of web interface, wherein, in the time of in the visibility region of judging the upper left corner of pop-up box and be not presented at web interface, confirm that pop-up box is not all presented in the visibility region of web interface, it should be noted that, pop-up box is rectangle pop-up box.
If the first acquisition module 201 is for judging in the upper left corner of pop-up box and/or visibility region that the lower right corner is not presented at web interface, obtain the size of the visibility region of web interface, wherein, the size of the visibility region of web interface is the size of the visibility region actual displayed of web interface, particularly, the first acquisition module 201 can be for obtaining the height of the length of visibility region and the visibility region of web interface of web interface.
The second acquisition module 202 is for obtaining the size of pop-up box actual displayed.Particularly, the second acquisition module 202 can be for obtaining the height of length and the pop-up box actual displayed of pop-up box actual displayed.In embodiments of the present invention, the second acquisition module 202 can comprise that first obtains submodule, second and obtain submodule and definite submodule.The second acquisition module 202 can obtain the height of length and the pop-up box actual displayed of pop-up box actual displayed in the following manner: first obtains submodule for obtaining the upper left corner coordinate of the first sub-pop-up box, second obtains submodule for obtaining the upper left corner coordinate of the second sub-pop-up box, wherein, the first sub-pop-up box and the second sub-pop-up box are separately positioned on the upper left corner of pop-up box and the lower right corner of pop-up box, and the size of the first sub-pop-up box and the second sub-pop-up box is 0px; Determine that submodule is for according to the upper left corner coordinate of the upper left corner coordinate of the first sub-pop-up box and the second sub-pop-up box, determine the height of length and the pop-up box actual displayed of pop-up box actual displayed, wherein, the height of the length of pop-up box actual displayed and pop-up box actual displayed calculates by following formula:
The upper left corner horizontal ordinate of the sub-pop-up box of upper left corner horizontal ordinate-the first of the sub-pop-up box of length=the second of pop-up box actual displayed,
The upper left corner ordinate of the sub-pop-up box of upper left corner ordinate-the first of the sub-pop-up box of height=the second of pop-up box actual displayed.
The 3rd acquisition module 203 is for obtaining the old position of pop-up box.Particularly, the 3rd acquisition module 203 can be for obtaining the old coordinate in the upper left corner and/or the old coordinate in the lower right corner of pop-up box.
Determination module 204 is for according to the reposition of the old location positioning pop-up box of the size of the size of the visibility region of web interface and pop-up box actual displayed and pop-up box, wherein, the reposition of pop-up box refers to that pop-up box is all presented at the position of the visibility region of web interface again, particularly, determination module 204 can be for according to the length of the height of the visibility region of the length of the visibility region of web interface and web interface and pop-up box actual displayed and the old coordinate in the height of pop-up box actual displayed and the upper left corner of pop-up box and/or the old coordinate in the lower right corner, determine the new coordinate in the upper left corner and/or the new coordinate in the lower right corner of pop-up box.Wherein, the new coordinate in the upper left corner of pop-up box can calculate by following formula:
The length of old coordinate-pop-up box actual displayed in the upper left corner of the length-pop-up box of the visibility region of the new coordinate=web interface in the upper left corner of pop-up box,
The height of old coordinate-pop-up box actual displayed in the upper left corner of the height-pop-up box of the visibility region of the new coordinate=web interface in the upper left corner of pop-up box.
From above description, can find out, the present invention has realized the object that whether changes the relative position of adjusting pop-up box and web interface according to the visibility region of the web interface detecting, while having avoided the visibility region of web interface to change, pop-up box is by some or all of situation of blocking, and then reached the effect in the visibility region that keeps pop-up box to be presented at all the time web interface.
It should be noted that, in the step shown in the process flow diagram of accompanying drawing, can in the computer system such as one group of computer executable instructions, carry out, and, although there is shown logical order in flow process, but in some cases, can carry out shown or described step with the order being different from herein.
Obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in memory storage and be carried out by calculation element, or they are made into respectively to each integrated circuit modules, or a plurality of modules in them or step are made into single integrated circuit module to be realized.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.