CN103677576B - Close the method and device of window - Google Patents

Close the method and device of window Download PDF

Info

Publication number
CN103677576B
CN103677576B CN201210341685.7A CN201210341685A CN103677576B CN 103677576 B CN103677576 B CN 103677576B CN 201210341685 A CN201210341685 A CN 201210341685A CN 103677576 B CN103677576 B CN 103677576B
Authority
CN
China
Prior art keywords
coordinate
window
terminal
dragging
sliding distance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210341685.7A
Other languages
Chinese (zh)
Other versions
CN103677576A (en
Inventor
蔡荧园
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201210341685.7A priority Critical patent/CN103677576B/en
Publication of CN103677576A publication Critical patent/CN103677576A/en
Application granted granted Critical
Publication of CN103677576B publication Critical patent/CN103677576B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of method and devices for closing window, belong to browser technology field.The method includes:When detecting that opened on the page a window is dragged, the coordinate of the coordinate and second position point of first position point during the dragging is recorded;When the coordinate of coordinate and second position point according to the first position point closes the dragged window when determining that the degrees of offset of the dragging in the direction indicated reaches preset condition;Wherein, when the window on the page is to be arranged above and below, the assigned direction is that laterally, when the window on the page is left-right situs, the assigned direction is longitudinal.Described device includes:Logging modle and closedown module.The present invention realizes the closing that window is triggered according to drag operation, easy to operate, greatly facilitates user's use.

Description

Close the method and device of window
Technical field
The present invention relates to browser technology field, more particularly to a kind of method and device for closing window.
Background technology
In existing touch screen type mobile terminal, when browser opens multiple windows, multi-window managing interface can be entered, The multiple windows having already turned on are shown by the form of tiling or full window stacking on the surface.When user's closing is therein When some window, need to click the button of fixed position on the window to execute the operation for closing the window.The button can be with For icon or word button.For example, in the upper right corner of each window there are one icon, it is generally circular and on Face shows × symbol of shape, when the user clicks when the icon, browser can close the window.
But it is above-mentioned in the prior art, window could be closed by needing user to move a finger to fixed area, if it is the page It is particularly convenient that the window at both ends, which then operates not,.
Invention content
In order to solve problems in the prior art, an embodiment of the present invention provides a kind of method and devices for closing window.Institute It is as follows to state technical solution:
On the one hand, a method of window is closed, the method includes:
When detecting that opened on the page a window is dragged, the seat of first position point during the dragging is recorded The coordinate of mark and second position point;
When the coordinate according to the coordinate and second position point of the first position point, the dragging is determined in the direction indicated Degrees of offset when reaching preset condition, close the dragged window;
Wherein, when the window on the page is to be arranged above and below, the assigned direction is laterally, when on the page When window is left-right situs, the assigned direction is longitudinal.
Wherein, the first position point is the starting point of the dragging, and the second position point is the terminal of the dragging;
When the coordinate according to the coordinate and second position point of the first position point, the dragging is determined in the direction indicated Degrees of offset when reaching preset condition, close the dragged window, including:
According to the coordinate of the coordinate of the starting point and terminal, first sliding of the dragging on the assigned direction is calculated Distance;
When first sliding distance is more than preset first threshold, the dragged window is closed.
Wherein, according to the coordinate of the coordinate of the starting point and terminal, the of the dragging on the assigned direction is calculated One sliding distance, including:
When the assigned direction is lateral, laterally the first sliding distance=Xn-X0 of the dragging;
When the assigned direction is longitudinal, longitudinal first sliding distance=Yn-Y0 of the dragging;
Wherein, X0, Y0 are the abscissa and ordinate of the starting point, and Xn, Yn are the abscissa and ordinate of the terminal.
Wherein, the first position point is the record time location point adjacent with the dragging terminal, the second position Point is the terminal of the dragging, and the record time interval of the record time of first position point and the terminal is preset Period;
When the coordinate according to the coordinate and second position point of the first position point, the dragging is determined in the direction indicated Degrees of offset when reaching preset condition, close the dragged window, including:
According to the coordinate of location point, the coordinate of the terminal and the preset week that the record time is adjacent with the dragging terminal Phase calculates sliding speed of the dragging on the assigned direction;
When the sliding speed is more than preset second threshold, the dragged window is closed.
Wherein, the method further includes:
When first sliding distance is less than or equal to preset first threshold, according to the coordinate for pulling starting point and end The coordinate of point, calculates second sliding distance of the dragging on the direction vertical with the assigned direction, and when according to record Between with the dragging terminal adjacent coordinate of location point, the coordinate of the terminal and preset period, calculate described pull and exist Sliding speed on the assigned direction;
When first sliding distance is more than second sliding distance and the sliding speed is more than preset second threshold When value, the dragged window is closed;
Wherein, the record time is with the time interval between the dragging adjacent location point of terminal and the terminal The preset period.
Wherein, according to record time and the adjacent coordinate of location point of the dragging terminal, the coordinate of the terminal and in advance If period, calculate the sliding speed of the dragging on the assigned direction, including:
It is described to pull lateral sliding speed=(Xn-Xm)/T when the assigned direction is lateral;
It is described to pull longitudinal sliding speed=(Yn-Ym)/T when the assigned direction is longitudinal;
Wherein, Xn, Yn are respectively the abscissa and ordinate for pulling terminal, and Xm, Ym are respectively the record time The abscissa and ordinate of the location point adjacent with the dragging terminal, T are the preset period.
On the other hand, a kind of device for closing window, described device include:
Logging modle, for during when detecting that opened on the page window is dragged, recording the dragging The coordinate of the coordinate and second position point of first position point;
Closedown module is used to work as the coordinate of coordinate and second position point according to the first position point, is dragged described in determination When the degrees of offset for dragging in the direction indicated reaches preset condition, the dragged window is closed;
Wherein, when the window on the page is to be arranged above and below, the assigned direction is laterally, when on the page When window is left-right situs, the assigned direction is longitudinal.
Wherein, the first position point is the starting point of the dragging, and the second position point is the terminal of the dragging;
The closedown module includes:
First computing unit, for according to the coordinate of the starting point and the coordinate of terminal, calculating the dragging in the finger Determine the first sliding distance on direction;
First closing unit, for when first sliding distance is more than preset first threshold, closing described dragged The window dragged.
Wherein, first computing unit for being calculated as follows:
When the assigned direction is lateral, laterally the first sliding distance=Xn-X0 of the dragging;
When the assigned direction is longitudinal, longitudinal first sliding distance=Yn-Y0 of the dragging;
Wherein, X0, Y0 are the abscissa and ordinate of the starting point, and Xn, Yn are the abscissa and ordinate of the terminal.
Wherein, the first position point is the record time location point adjacent with the dragging terminal, the second position Point is the terminal of the dragging, and the record time interval of the record time of first position point and the terminal is preset Period;
The closedown module includes:
Second computing unit, for the coordinate according to the record time location point adjacent with the dragging terminal, the end The coordinate of point and preset period calculate sliding speed of the dragging on the assigned direction;
Second closing unit, for when the sliding speed is more than preset second threshold, closing described dragged Window.
Wherein, the closedown module is additionally operable to:
When first sliding distance is less than or equal to preset first threshold, according to the coordinate for pulling starting point and end The coordinate of point, calculates second sliding distance of the dragging on the direction vertical with the assigned direction, and when according to record Between with the dragging terminal adjacent coordinate of location point, the coordinate of the terminal and preset period, calculate described pull and exist Sliding speed on the assigned direction;
When first sliding distance is more than second sliding distance and the sliding speed is more than preset second threshold When value, the dragged window is closed;
Wherein, the record time is with the time interval between the dragging adjacent location point of terminal and the terminal The preset period.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:First during being pulled by record window The coordinate of location point and second position point, and pulled in assigned direction being determined according to first position point and second position point coordinates On degrees of offset when reaching preset condition, close dragged window, realize the pass for triggering window according to drag operation It closes, moving a finger to fixed area without user can trigger closing window, and user can be in any position of the window Place is pulled to trigger closing window, easy to operate, greatly facilitates user's use.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings Attached drawing.
Fig. 1 is a kind of method flow diagram for closing window that one embodiment of the invention provides;
Fig. 2 is a kind of method flow diagram for closing window that another embodiment of the present invention provides;
Fig. 3 is the schematic diagram that window is closed in drag operation triggering provided in an embodiment of the present invention;
Fig. 4 is a kind of method flow diagram for closing window that further embodiment of this invention provides;
Fig. 5 is a kind of method flow diagram for closing window that yet another embodiment of the invention provides;
Fig. 6 is a kind of structure drawing of device for closing window provided in an embodiment of the present invention;
Fig. 7 is another structure drawing of device for closing window provided in an embodiment of the present invention.
Specific implementation mode
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
Referring to Fig. 1, one embodiment of the invention provides a kind of method for closing window, including:
101:When detecting that opened on the page a window is dragged, the seat of first position point during record pulls The coordinate of mark and second position point.
102:When the coordinate according to the coordinate and second position point of first position point, determines and pull in the direction indicated inclined When shifting degree reaches preset condition, dragged window is closed.
Wherein, when the window on the page is to be arranged above and below, the assigned direction is laterally, when on the page When window is left-right situs, the assigned direction is longitudinal.
The above method provided in this embodiment can specifically be executed by browser, which is located in mobile terminal.It should Browser can be any type browser, and the present invention is not specifically limited this.The mobile terminal includes but not limited to:Hand Machine, tablet computer etc., it is preferable that be touch screen type mobile terminal.
The window is shown on the page of browser opening, and the window opened simultaneously on the page can be multiple, tool Body number does not limit.The orientation of window includes on the page:It is arranged above and below or left-right situs.When on the window on the page When lower arrangement, user is slided up and down or is pulled each window that can be opened with preview by finger, when the window or so on the page When arrangement, user is horizontally slipped or is pulled each window that can be opened with preview by finger.
The screen that the dragging can be touched mobile terminal by user with finger carries out, and user's finger touches during dragging Position can be indicated with the coordinate of pixel on screen, including abscissa and ordinate.The starting point of dragging refers to user's finger The position pressed on the screen, the terminal of dragging refer to the position that user's finger is lifted at the end of dragging from screen.
The above method provided in this embodiment, first position point and second position point during being pulled by record window Coordinate, and determining that the degrees of offset pulled in the direction indicated reaches default according to first position point and second position point coordinates Condition when, close dragged window, realize according to drag operation trigger window closing, moved a finger to without user Fixed area can trigger and close window, and user can be pulled in any position of the window to trigger closing window Mouthful, it is easy to operate, greatly facilitate user's use.
Referring to Fig. 2, another embodiment of the present invention provides a kind of method for closing window, including:
201:When detecting that opened on the page a window is dragged, record pulls the seat of the coordinate and terminal of starting point Mark.
In the present embodiment, the direction of drag operation includes but not limited to:Upwards, downwards, to the left, to the right, obliquely upward, to Obliquely downward etc..Wherein, different drag direction, which can be corresponding with, different slides laterally distance and longitudinal sliding motion distance.For example, When pulling upward or downward, only longitudinal sliding motion distance;It is existing to slide laterally distance when being pulled to page upper left angular direction There is longitudinal sliding motion distance again;Certainly, also other a variety of situations, differ a citing herein.
202:According to the coordinate of the coordinate of starting point and terminal, the first sliding distance pulled in the direction indicated is calculated.
Wherein, when the window on the page is to be arranged above and below, the assigned direction is laterally, when on the page When window is left-right situs, the assigned direction is longitudinal.
This step can specifically include:
When the assigned direction is lateral, laterally the first sliding distance=Xn-X0 of dragging;
When the assigned direction is longitudinal, longitudinal first sliding distance=Yn-Y0 of dragging;
Wherein, X0, Y0 are the abscissa and ordinate for pulling starting point, and Xn, Yn are the abscissa and ordinate for pulling terminal.
In the present embodiment, when window is dragged, the position of window can also change, and correspondingly, can be shown on the page The effect of window sliding.For example, in the multiple windows being arranged above and below, the coordinate in the wherein upper left corner of some window i is(WX0, WY0), after window i is pulled to the upper left corner, then the changes in coordinates in the upper left corner of window i is(WX0+Xn-X0, WY0+Yn- Y0).Wherein, window sliding may be used animation effect and be shown, and the present invention does not do excessive explanation.
203:When pulling the first sliding distance in the direction indicated more than preset first threshold, close dragged Window.
Wherein, the first threshold be pre-set empirical value, can modify as needed, the present invention to this not It is specifically limited.When the first sliding distance is more than preset first threshold, it is believed that the window enters critical zone, which is to close Close the trigger action of the window, rather than other operations.
Referring to Fig. 3, the schematic diagram of window is closed for drag operation provided in this embodiment triggering.Wherein, mobile terminal Browser opens 4 windows, is respectively:Mobile phone Sina website, mobile phone www.qq.com, Tencent's microblogging and mobile phone sohu.com, and by this 4 A window is shown from top to bottom according to open sequence, when the user clicks and after the 2nd window of dragging, according to the cross for pulling generation Determine whether to close the window to sliding distance and preset threshold value, if it is determined that close the window, then execute and close the 2nd window The operation of mouth.
The above method provided in this embodiment, the coordinate of beginning and end during being pulled by record window, and in root When determining that the degrees of offset of dragging in the direction indicated reaches preset condition according to beginning and end coordinate, dragged window is closed Mouthful, the closing that window is triggered according to drag operation is realized, moving a finger to fixed area without user can trigger closing window Mouthful, and user can be pulled in any position of the window to trigger closing window, and it is easy to operate, it is greatly convenient User use.
Referring to Fig. 4, further embodiment of this invention provides a kind of method for closing window, including:
401:When detecting that opened on the page a window is dragged, the seat of first position point during record pulls The coordinate of mark and second position point.
Wherein, first position point is the record time location point adjacent with terminal is pulled, and second position point is the end pulled Point, and the record time of first position point and the record time interval of terminal are the preset period.
The preset period can be arranged as required to, and concrete numerical value is unlimited, such as 3ms, 5ms.When the record Between refer to time that the position to dragging during window is dragged is recorded, be a continuous action due to pulling, A track can be generated on the screen, and there are one coordinates for each point on track.It, can in order to improve efficiency and save the time Coordinate is recorded to choose partial dot therein, and is calculated accordingly according to the coordinate of record.It is described it is adjacent refer to record It is temporally adjacent.
Preferably, it can once be pulled every the periodic recording current according to the preset period since the starting point of dragging The coordinate of location point, the coordinate record until pulling terminal are completed.For example, the preset period is 2ms, dragging process continue for 10ms then has recorded 6 times from the starting point to the end of dragging altogether, and first record is the coordinate for pulling starting point, and last time records Be the coordinate for pulling terminal, the coordinate of 2nd record reciprocal is exactly to record the time to record temporally adjacent location point with terminal Coordinate.
402:According to record time and the dragging terminal adjacent coordinate of location point, the coordinate of terminal and preset period, Calculate the sliding speed pulled in the direction indicated.
Wherein, when the window on the page is to be arranged above and below, the assigned direction is laterally, when on the page When window is left-right situs, the assigned direction is longitudinal.
Specifically, this step may include:
When the assigned direction is lateral, lateral sliding speed=(Xn-Xm)/T is pulled;
When the assigned direction is longitudinal, longitudinal sliding speed=(Yn-Ym)/T is pulled;
Wherein, Xn, Yn are respectively the abscissa and ordinate for pulling terminal, and Xm, Ym are respectively to record the time and pull eventually The abscissa and ordinate of the adjacent location point of point, T are the preset period.
403:When pulling sliding speed in the direction indicated more than preset second threshold, dragged window is closed Mouthful.
Specifically, this step may include:
When the assigned direction is lateral, if (Xn-Xm)/T > V, close dragged window;
When the assigned direction is longitudinal, if (Yn-Ym)/T > V, close dragged window;
Wherein, V is preset second threshold, can be arranged as required to, the concrete numerical value present invention does not limit.
In the present embodiment, in order to calculate simplicity, further, can also second threshold be set according to preset cycle T, such as Set T × V to second threshold, then and by (Xn-Xm) or (Yn-Ym) be considered as sliding speed, then when comparing can directly by (Xn-Xm) or (Yn-Ym) is compared with second threshold, and to simplify calculating process, calculating is easier, improves calculating Efficiency.
The above method provided in this embodiment, the record time is adjacent with terminal is pulled during being pulled by record window Position point coordinates, and the coordinate of terminal is pulled, and the offset journey pulled in the direction indicated is being determined according to the coordinate of record When degree reaches preset condition, dragged window is closed, realizes the closing for triggering window according to drag operation, is not necessarily to user It moves a finger to fixed area and can trigger closing window, and user can be pulled to come in any position of the window Window is closed in triggering, easy to operate, greatly facilitates user's use.
Referring to Fig. 5, yet another embodiment of the invention provides a kind of method for closing window, including:
501:When detecting that opened on the page a window is dragged, record pulls the seat of the coordinate and terminal of starting point Mark.
502:According to the coordinate of the coordinate of starting point and terminal, the first sliding distance pulled in the direction indicated is calculated.
Wherein, when the window on the page is to be arranged above and below, the assigned direction is laterally, when on the page When window is left-right situs, the assigned direction is longitudinal.
The specific calculating process of this step is identical as the description in above-mentioned steps 202, does not repeat herein.
503:Whether the first sliding distance for judging to pull in the direction indicated is more than preset first threshold, if so, Then execute 504;Otherwise, 505 are executed.
Wherein, the first threshold be pre-set empirical value, can modify as needed, the present invention to this not It is specifically limited.When the first sliding distance is more than preset first threshold, it is believed that the window enters critical zone, which is to close Close the trigger action of the window, rather than other operations.
504:Dragged window is closed, flow terminates.
505:At this point, the first sliding distance is less than or equal to preset first threshold, according to the coordinate and terminal for pulling starting point Coordinate, calculate and pull the second sliding distance on the direction vertical with assigned direction, and according to the record time with pull eventually The coordinate of the adjacent location point of point, the coordinate of terminal and preset period, calculate the sliding speed pulled in the direction indicated.
Specifically, when the assigned direction is lateral, the vertical direction is longitudinal, when the assigned direction is longitudinal When, the vertical direction is laterally.The record time with pull between time between the adjacent location point and terminal of terminal It is divided into the preset period.
Wherein, the coordinate of location point, the coordinate of terminal and the preset period adjacent with terminal is pulled according to the record time, Calculating the sliding speed pulled in the direction indicated can specifically include:
When the assigned direction is lateral, lateral sliding speed=(Xn-Xm)/T is pulled;
When the assigned direction is longitudinal, longitudinal sliding speed=(Yn-Ym)/T is pulled;
Wherein, Xn, Yn are respectively the abscissa and ordinate for pulling terminal, and Xm, Ym are respectively to record the time and pull eventually The abscissa and ordinate of the adjacent location point of point, T are the preset period.
506:When the first sliding distance is more than the second sliding distance and sliding speed is more than preset second threshold, close Dragged window, flow terminate.
Wherein, when being compared, it is compared with the absolute value of the first sliding distance and the second sliding distance.Example Such as, by taking assigned direction is transverse direction as an example, judge whether | Xn-X0| > | Yn-Y0|, wherein X0, Y0 are the horizontal seat for pulling starting point Mark and ordinate, Xn, Yn are the abscissa and ordinate for pulling terminal, | Xn-X0 | it is the absolute value for sliding laterally distance, | Yn-Y0 | it is the absolute value of longitudinal sliding motion distance.
If it is more than second threshold that the first sliding distance, which is more than the second sliding distance and sliding speed, then it is assumed that the dragging is The operation for closing window, to execute the operation for closing window;Otherwise, the behaviour for going back parent window is executed after the window's position movement Make, will the window be shown in pull before position on, the effect that animation may be used in detailed process is shown, the present invention This is not specifically limited.
The above method provided in this embodiment, by calculating the first sliding distance, the second sliding distance and sliding speed, And when determining that the degrees of offset of dragging in the direction indicated reaches preset condition according to result of calculation, close dragged window Mouthful, the closing that window is triggered according to drag operation is realized, moving a finger to fixed area without user can trigger closing window Mouthful, and user can be pulled in any position of the window to trigger closing window, and it is easy to operate, it is greatly convenient User use.
Referring to Fig. 6, another embodiment of the present invention additionally provides a kind of device for closing window, including:
Logging modle 601, for when detecting that opened on the page window is dragged, record pull during the The coordinate of the coordinate of one location point and second position point;
Closedown module 602, the coordinate for working as coordinate and second position point according to first position point determine that dragging is referring to When determining the degrees of offset on direction and reaching preset condition, dragged window is closed;
Wherein, when the window on the page is to be arranged above and below, assigned direction is laterally, when the window on the page is that left and right is arranged When row, assigned direction is longitudinal.
Referring to Fig. 7, under a kind of embodiment, first position point is the starting point pulled, and second position point be the terminal of dragging; Closedown module 602 includes:
First computing unit 602a, for according to the coordinate of starting point and the coordinate of terminal, calculating and pulling in the direction indicated The first sliding distance;
First closing unit 602b, for when the first sliding distance is more than preset first threshold, closing dragged Window.
Wherein, the first computing unit can be specifically used for being calculated as follows:
When assigned direction is lateral, laterally the first sliding distance=Xn-X0 of dragging;
When assigned direction is longitudinal, longitudinal first sliding distance=Yn-Y0 of dragging;
Wherein, X0, Y0 are the abscissa and ordinate of starting point, and Xn, Yn are the abscissa and ordinate of terminal.
Under another embodiment, first position point is the record time location point adjacent with terminal is pulled, the second position Point is the terminal pulled, and the record time of first position point and the record time interval of terminal are the preset period;Close mould Block 602 includes:
Second computing unit 602c, for according to record time and the coordinate of the adjacent location point of dragging terminal, terminal Coordinate and preset period calculate the sliding speed pulled in the direction indicated;
Second closing unit 602d, for when sliding speed is more than preset second threshold, closing dragged window.
Under another embodiment, closedown module 602 is additionally operable to:
When the first sliding distance is less than or equal to preset first threshold, according to the seat for the coordinate and terminal for pulling starting point Mark calculates the second sliding distance pulled on the direction vertical with assigned direction, and according to record time and dragging terminal phase The adjacent coordinate of location point, the coordinate of terminal and the preset period calculates the sliding speed pulled in the direction indicated;
When the first sliding distance is more than the second sliding distance and sliding speed is more than preset second threshold, closing is dragged The window dragged;
Wherein, the record time is the preset period with the time interval pulled between the adjacent location point and terminal of terminal.
In the present embodiment, according to the record time with pull the adjacent coordinate of location point of terminal, the coordinate of terminal and preset Period, calculate and pull sliding speed in the direction indicated and can specifically include:
When the assigned direction is lateral, lateral sliding speed=(Xn-Xm)/T is pulled;
When the assigned direction is longitudinal, longitudinal sliding speed=(Yn-Ym)/T is pulled;
Wherein, Xn, Yn are respectively the abscissa and ordinate for pulling terminal, and Xm, Ym are respectively to record the time and pull eventually The abscissa and ordinate of the adjacent location point of point, T are the preset period.
Described device provided in this embodiment can be located in browser, which is installed in mobile terminal.
Above-mentioned apparatus provided in this embodiment, first position point and second position point during being pulled by record window Coordinate, and determining that the degrees of offset pulled in the direction indicated reaches default according to first position point and second position point coordinates Condition when, close dragged window, realize according to drag operation trigger window closing, moved a finger to without user Fixed area can trigger and close window, and user can be pulled in any position of the window to trigger closing window Mouthful, it is easy to operate, greatly facilitate user's use.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.

Claims (5)

1. a kind of method for closing window, which is characterized in that the method includes:
When detecting that opened on the page a window is dragged, the seat of the starting point of the dragging during the dragging is recorded The coordinate of mark and the terminal of the dragging;
According to the coordinate of the coordinate of the starting point and terminal, the first sliding distance of the dragging in the direction indicated is calculated;
Wherein, when the window on the page is to be arranged above and below, the assigned direction is the laterally window on the page For left-right situs when, the assigned direction is longitudinal;
When first sliding distance is more than preset first threshold, the dragged window is closed;
When first sliding distance is less than or equal to preset first threshold, according to the coordinate of the starting point and the terminal Coordinate, calculate second sliding distance of the dragging on the direction vertical with the assigned direction, and according to the record time The coordinate of the location point adjacent with the terminal, the coordinate of the terminal and preset period calculate the dragging in the finger Determine the sliding speed on direction;
When first sliding distance is more than second sliding distance and the sliding speed is more than preset second threshold, Close the dragged window;
Wherein, the time interval between the record time location point adjacent with the terminal and the terminal is described default Period.
2. according to the method described in claim 1, it is characterized in that, according to the coordinate of the coordinate of the starting point and terminal, calculate First sliding distance of the dragging on the assigned direction, including:
When the assigned direction is lateral, laterally the first sliding distance=Xn-X0 of the dragging;
When the assigned direction is longitudinal, longitudinal first sliding distance=Yn-Y0 of the dragging;
Wherein, X0, Y0 are the abscissa and ordinate of the starting point, and Xn, Yn are the abscissa and ordinate of the terminal.
3. according to the method described in claim 1, it is characterized in that, pulling the adjacent position of terminal with described according to the record time The coordinate of point, the coordinate of the terminal and preset period calculate sliding speed of the dragging on the assigned direction, packet It includes:
It is described to pull lateral sliding speed=(Xn-Xm)/T when the assigned direction is lateral;
It is described to pull longitudinal sliding speed=(Yn-Ym)/T when the assigned direction is longitudinal;
Wherein, Xn, Yn are respectively the abscissa and ordinate for pulling terminal, and Xm, Ym are respectively the record time and institute The abscissa and ordinate for pulling the adjacent location point of terminal are stated, T is the preset period.
4. a kind of device for closing window, which is characterized in that described device includes:
Logging modle, for when detecting that opened on the page window is dragged, recording first during the dragging The coordinate of the coordinate of location point and second position point;
Closedown module, the coordinate for working as coordinate and second position point according to the first position point determine that described pull exists When degrees of offset on assigned direction reaches preset condition, the dragged window is closed;
Wherein, when the window on the page is to be arranged above and below, the assigned direction is the laterally window on the page For left-right situs when, the assigned direction is longitudinal;
Wherein, the first position point is the starting point of the dragging, and the second position point is the terminal of the dragging;The pass Mold closing block includes:
First computing unit, for according to the coordinate of the starting point and the coordinate of terminal, calculating the dragging in the designated parties The first upward sliding distance;
First closing unit, for when first sliding distance is more than preset first threshold, closing described dragged Window;
Wherein, the closedown module is additionally operable to:
When first sliding distance is less than or equal to preset first threshold, according to the coordinate and terminal for pulling starting point Coordinate, calculates second sliding distance of the dragging on the direction vertical with the assigned direction, and according to the record time with The coordinate of the adjacent location point of the terminal, the coordinate of the terminal and preset period calculate described pull described specified Sliding speed on direction;
When first sliding distance is more than second sliding distance and the sliding speed is more than preset second threshold, Close the dragged window;
Wherein, the time interval between the record time location point adjacent with the terminal and the terminal is described default Period.
5. device according to claim 4, which is characterized in that first computing unit for being calculated as follows:
When the assigned direction is lateral, laterally the first sliding distance=Xn-X0 of the dragging;
When the assigned direction is longitudinal, longitudinal first sliding distance=Yn-Y0 of the dragging;
Wherein, X0, Y0 are the abscissa and ordinate of the starting point, and Xn, Yn are the abscissa and ordinate of the terminal.
CN201210341685.7A 2012-09-14 2012-09-14 Close the method and device of window Active CN103677576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210341685.7A CN103677576B (en) 2012-09-14 2012-09-14 Close the method and device of window

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210341685.7A CN103677576B (en) 2012-09-14 2012-09-14 Close the method and device of window

Publications (2)

Publication Number Publication Date
CN103677576A CN103677576A (en) 2014-03-26
CN103677576B true CN103677576B (en) 2018-09-04

Family

ID=50315313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210341685.7A Active CN103677576B (en) 2012-09-14 2012-09-14 Close the method and device of window

Country Status (1)

Country Link
CN (1) CN103677576B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104049900A (en) * 2014-06-30 2014-09-17 北京安兔兔科技有限公司 Floating window closing method and device
CN105808074A (en) * 2016-03-31 2016-07-27 浙江慧脑信息科技有限公司 Method for controlling new establishment, switching and closing of pages
CN106873858A (en) * 2017-03-03 2017-06-20 昆山小丫信息科技有限公司 A kind of method and apparatus for showing message
CN106934657B (en) * 2017-03-07 2020-01-17 北京齐尔布莱特科技有限公司 Page exposure data acquisition method and device and mobile terminal
CN107085614A (en) * 2017-05-22 2017-08-22 深圳天珑无线科技有限公司 The processing method and device of a kind of browser window
CN109085984B (en) 2018-06-29 2019-10-18 北京微播视界科技有限公司 Control method, device, terminal device and the storage medium of information flow display panel
CN112363668A (en) * 2020-11-18 2021-02-12 北京百家科技集团有限公司 Multi-view interaction method and device, mobile terminal and computer equipment
CN113434079A (en) * 2021-05-28 2021-09-24 北京信和时代科技有限公司 Control method, device and equipment for event recording application and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1936782A (en) * 2006-10-13 2007-03-28 广东威创日新电子有限公司 Intelligent code-inputting method based on interaction type input apparatus
CN101739198A (en) * 2008-11-06 2010-06-16 环达电脑(上海)有限公司 Touch operation method and device thereof
CN101770332A (en) * 2009-01-05 2010-07-07 联想(北京)有限公司 User interface method, user interface device and terminal
CN102184255A (en) * 2011-05-30 2011-09-14 昆山富泰科电脑有限公司 Method for performing multi-web page browse switching on portable multifunctional equipment and user graphical interface
CN102521034A (en) * 2011-12-27 2012-06-27 惠州Tcl移动通信有限公司 Multitask management method and multitask management system based on android system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8683362B2 (en) * 2008-05-23 2014-03-25 Qualcomm Incorporated Card metaphor for activities in a computing device
US20080084400A1 (en) * 2006-10-10 2008-04-10 Outland Research, Llc Touch-gesture control of video media play on handheld media players

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1936782A (en) * 2006-10-13 2007-03-28 广东威创日新电子有限公司 Intelligent code-inputting method based on interaction type input apparatus
CN101739198A (en) * 2008-11-06 2010-06-16 环达电脑(上海)有限公司 Touch operation method and device thereof
CN101770332A (en) * 2009-01-05 2010-07-07 联想(北京)有限公司 User interface method, user interface device and terminal
CN102184255A (en) * 2011-05-30 2011-09-14 昆山富泰科电脑有限公司 Method for performing multi-web page browse switching on portable multifunctional equipment and user graphical interface
CN102521034A (en) * 2011-12-27 2012-06-27 惠州Tcl移动通信有限公司 Multitask management method and multitask management system based on android system

Also Published As

Publication number Publication date
CN103677576A (en) 2014-03-26

Similar Documents

Publication Publication Date Title
CN103677576B (en) Close the method and device of window
CN105511784B (en) A kind of data inputting method based on pressure detecting, device and mobile terminal
CN102681786B (en) Method and device for text selection
US9696879B2 (en) Tab scrubbing using navigation gestures
CN104603733B (en) User terminal apparatus and its control method
CN101980153B (en) Method and mobile terminal for identifying hardware gestures
CN102681774B (en) Method and device for controlling application interface through gesture and mobile terminal
CN102520860B (en) A kind of method and mobile terminal for carrying out desktop display control
CN103995660B (en) The method and device of touch screen browser switch window
CN103294346B (en) The window moving method and its device of a kind of mobile device
JP6448639B2 (en) Text selection method, apparatus and terminal
CN106648434A (en) Method and device for controlling application interfaces through dragging gesture
JP2014501996A5 (en)
CN104714748A (en) Method and apparatus for controlling an electronic device screen
CN102902407B (en) A kind of touch-screen output display touches the method and apparatus of person's handwriting
CN101710268A (en) Method and device for adjusting page layout
CN103677538A (en) Multi-window display method and device
US20180136834A1 (en) Gesture-based selection and manipulation method
TW201222344A (en) Method for continuing a multi-finger gesture on a touch panel
CN104077056B (en) Translation method and system for page displayed on screen
CN107179875B (en) The method and apparatus of window adjustment
CN102955668A (en) Method for selecting objects and electronic equipment
CN103150093A (en) Operation prompt identifier moving method, device and terminal
CN103809954B (en) Method and device for realizing interface element selection
CN103500055B (en) Positioning method and system of display content of touch screen

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant