CN103164191B - Web page element dragging method and device - Google Patents

Web page element dragging method and device Download PDF

Info

Publication number
CN103164191B
CN103164191B CN201110405826.2A CN201110405826A CN103164191B CN 103164191 B CN103164191 B CN 103164191B CN 201110405826 A CN201110405826 A CN 201110405826A CN 103164191 B CN103164191 B CN 103164191B
Authority
CN
China
Prior art keywords
container
pulled
superiors
web page
current location
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
CN201110405826.2A
Other languages
Chinese (zh)
Other versions
CN103164191A (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 CN201110405826.2A priority Critical patent/CN103164191B/en
Publication of CN103164191A publication Critical patent/CN103164191A/en
Application granted granted Critical
Publication of CN103164191B publication Critical patent/CN103164191B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention discloses a kind of web page element dragging method and device, by the technical scheme of the application embodiment of the present invention, during web page element dragging, the coordinate information of the target location pulled according to web page element, determine the superiors' element that current web page element is dragged to, and when the superior node of the superiors' element or the superiors' element is container, during the web page element moved into cell therefor, complete the dragging of web page element, so as to, avoid determining in the prior art the complicated calculations process of all container positions and relevant parameter corresponding to position coordinates, and with the presence or absence of the deterministic process blocked, it is the determination of the dragging and corresponding container for being capable of achieving web page element by simple algorithm, improve the process performance and efficiency of the processing procedure that webpage is pulled.

Description

Web page element dragging method and device
Technical field
The present invention relates to communication technical field, more particularly to a kind of web page element dragging method and device.
Background technology
Webpage(Web page)It is the basic element for constituting website, is the platform for carrying various website applications.Webpage is deposited In the computer that a certain portion is connected with internet(Or server)In.
Webpage is via URL(Uniform/Universal Resource Locator, URL, i.e. net Location)To recognize and access, after user is input into network address in browser, by one section of complicated and quick program, web page files Computer where user can be sent to, then again by the content of browser-interpreted webpage, and is illustrated in user at the moment.
Webpage is WWW(World Wide Web, WWW)In one " page ", typically HTML(Hypertext Markup Language, text mark up language)Form(File extent entitled .html or .htm).Webpage will pass through web page browsing Device is read.
Dom(Document Object Model, DOM Document Object Model)Node is to constitute an element for webpage.DOM is A kind of abstract concept, it must include some characteristics, such as root node, child node and how to obtain the side of these nodes Method, such as in javascript, used as a document object for possessing DOM characteristics, HTML is exactly its root node to webpage, is accessed Certain node of webpage can use document.getElementById(' id Property Names '), if there is this node A DOM node is returned to, this node has nodeName(Nodename), nodeType(Node type)Deng related DOM Nodal community.
Dom nodes collectively form webpage.And the element that other elements are deposited in webpage is then referred to as " container ".
In actual application, in order to realize personal settings of the user for webpage, generally require by pulling come right Element in webpage is operated, so that, meet the demand of user.
In specific application scenarios, the purpose of dragging be finally in order to an element is moved on to a container in.
It is that there is currently more than one container to pull the premise realized, wherein, if there is multiple containers, then each container Do not include mutually each other, the positioning method of element is absolute fix(position:absolute).
In existing technical scheme, the implementation process that element is pulled is as shown in figure 1, when mouse is moved, calculate mouse This coordinate(A+xoffset, B+yoffset)With last time coordinate(A, B)Between difference, that is, determine pull after coordinate with pull The deviant of preceding coordinate(Xoffset, yoffset), so that, make the coordinate of dragged element(X, y)Plus corresponding same Difference be capable of achieving dragging.
When mouse discharges, the coordinate of mouse is obtained, calculate the absolute position of each container that can deposit dragged element Put, high wide and depth (z-index), whether mouse coordinates when judging mouse release fall the rectangular area where certain container It is interior, and the coordinate affiliated area is not blocked, if it is, during element moved on into the container.
During the embodiment of the present invention is realized, it is found by the applicant that at least there is problems with prior art:
The requirement of existing algorithm must be known by the position of all containers, size and depth when judging which container element fall at Degree, and this is not what is be readily available, particularly depth.
Even if in addition, obtain mouse this coordinate falling in the rectangular area of certain container, it is necessary to judge mouse this Whether the region where coordinate is blocked by other containers, and this by calculating the rectangular area of all containers, and must one by one enter Row judges to complete that calculating process is extremely complex, and due to needing to travel through the calculating for carrying out complexity, can influence respective handling process Performance and efficiency.
The content of the invention
The embodiment of the present invention provides a kind of web page element dragging method and device, solves at web page element in the prior art Reason process is excessively complicated, the problem of influence operating characteristics and efficiency.
To reach above-mentioned purpose, on the one hand the embodiment of the present invention provides a kind of web page element dragging method, methods described Specifically include:
When receiving when the operational order that element is dragged to current location and discharges is pulled, the seat of current location is obtained Mark information;
The superiors' element where determining the coordinate points corresponding to the coordinate information of the current location;
Judge whether the superiors' element is container;
If it is judged that be yes, during the element to be pulled moved into the container, if it is judged that be it is no, then Perform step A;
Step A, the parent element for obtaining the element that current judged result is no, then perform step B;
Step B, judge whether the parent element is container, if it is judged that being yes, the element to be pulled is moved Move in the container, if it is judged that being no, then perform step A.
On the other hand, the embodiment of the present invention additionally provides a kind of network equipment, specifically includes:
Receiver module, for when receiving when the operational order that element is dragged to current location and discharges is pulled, obtaining Take the coordinate information of current location;
Determining module, for determining the coordinate points corresponding to the coordinate information of the current location acquired in the receiver module The superiors' element at place;
Judge module, for judging whether element determined by the determining module is container;
Processing module, during for the judged result in the judge module to be, institute is moved to by the element to be pulled In stating container;
Wherein, the processing module is additionally operable to, when the judged result of the judge module is no, perform step A;
Step A, the parent element for obtaining the element that current judged result is no, then perform step B;
Step B, notify that the judge module judges whether the parent element is container, if it is judged that be it is yes, will The element to be pulled is moved in the container, if it is judged that being no, then performs step A.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, during web page element dragging, pulled according to web page element Target location coordinate information, determine the superiors' element that current web page element is dragged to, and in the superiors' element or When the superior node of the superiors' element is container, during the web page element moved into cell therefor, web page element is completed Pull, so that, it is to avoid the complicated calculations of all container positions and relevant parameter corresponding to position coordinates are determined in the prior art Process, and with the presence or absence of the deterministic process blocked, is to be capable of achieving the dragging of web page element and corresponding by simple algorithm The determination of container, improves the process performance and efficiency of the processing procedure that webpage is pulled.
Brief description of the drawings
Fig. 1 is the schematic diagram of the implementation process that element is pulled in the prior art;
Fig. 2 is a kind of schematic flow sheet of web page element dragging method that the embodiment of the present invention is proposed;
Fig. 3 is a kind of schematic diagram of concrete application scene that the embodiment of the present invention is proposed;
Fig. 4 A to 4C are respectively a kind of concrete application of application web page element dragging method of embodiment of the present invention proposition The schematic diagram of scape;
Fig. 5 is a kind of structural representation of network equipment that the embodiment of the present invention is proposed.
Specific embodiment
In existing technical scheme, it is necessary to according to final shift position, press in existing network element dragging scheme The absolute position of all containers that can deposit dragged element, wide and depth information high are calculated according to complicated algorithm, also to be entered Row whether the judgement blocked by other containers, the complex effects of the calculating process performance and efficiency of respective handling process.
In order to overcome such defect, the embodiment of the present invention to propose a kind of web page element dragging method, make full use of net Page the structural information of itself, web page element dragging during, according to web page element pull target location coordinate information it is true The superiors' element that settled preceding web page element is dragged to, and superior node in the superiors' element or the superiors' element is During container, during the web page element moved into cell therefor, the dragging of web page element is completed.
As shown in Fig. 2 a kind of schematic flow sheet of the web page element dragging method for embodiment of the present invention proposition, is applied to In system including multiple killing engines, the method specifically includes following steps:
Step S201, when receive will wait pull element be dragged to current location and discharge operational order when, obtain ought The coordinate information of front position.
During the dragging of specific network element, judgement of the operator to position for convenience will can be waited to pull unit Element is hidden, so that, the other elements in webpage will not be blocked because of element the to be pulled shape of itself, operator is influenceed to movement The observation of position and the anticipation to mobile effect, improve the simplicity and intuitive of operation.
Certainly, in specific treatment scene, above-mentioned hiding treatment can also be processed by shoaling or only display is treated The mode of the contour line of element is pulled, the region pulled shared by element is treated and is illustrated, so that operator can be to moving Position after dynamic shared by element to be pulled carries out anticipation.
In specific treatment scene, it is above-mentioned hide, shoal or scheme that profile show be intended merely to reach it is more preferable Operating effect and use can selection operation, if can't influence protection scope of the present invention including such operation.
It is further noted that above-mentioned coordinate information is directly with origin position defined in current web page region Based on identified relative position, the change of specific origin position and selection rule can't influence protection model of the invention Enclose.
The superiors' element where step S202, the coordinate points for determining corresponding to the coordinate information of the current location.
In specific treatment scene, the realization of this step can be by default API(Application Programming Interface, application programming interfaces)To realize.
In actual applications, API is some pre-defined functions, it is therefore an objective to provides application program and is based on developer Certain software or hardware to access one group of ability of routine, and source code, or the details for understanding internal work mechanism need not be accessed.
Therefore, after corresponding positional information is got, directly can be determined accordingly most by following processing procedure Upper strata element.
First, default API is obtained, and the coordinate information of the current location is input into the API.
After the corresponding function processing procedures of API are completed, the current location that the API is returned can be directly received The information of the superiors' element where the coordinate points corresponding to coordinate information.
It is pointed out that now, in above-mentioned step identified the superiors' element refer to remove element to be pulled it In outer other elements, the element of the superiors that the coordinate points corresponding to the coordinate information of current location are located at, because waiting to drag Drag during element currently pulls, it is clear that positioned at the superiors, if in being contained in, it is clear that the accurate of result can be influenceed Property, certainly, the scheme for specifically removing element to be pulled can directly hide element to be pulled, or determine in corresponding API Justice be take that the coordinate points corresponding to the coordinate information of current location are located in interior each element comprising element to be pulled time Upper strata element(Element to be pulled is the superiors' element), or the other modes of effect same can be reached, specifically processing In scene, the change of the particular content of the determination scheme for being used can't influence protection scope of the present invention.
Step S203, judge whether the superiors' element is container.
If it is judged that being yes, then step S206 is performed;
If it is judged that being no, then step S204 is performed.
Step S204, the parent element for obtaining the element that current judged result is no.
Then, step S205 is performed.
In actual applications, above-mentioned determination parent element implements form, Ke Yiwei:
By browser script javascript, judge that element determines current judged result using Dom node visit functions The parent element of the element for being no.
Due to having been defined for each element in current web page in browser script javascript and Dom node visit function Tree structure relation, therefore, it can be obtained by corresponding operation recursion the parent element of respective element.
Step S205, judge whether the parent element is container.
If it is judged that being yes, then step S206 is performed;
If it is judged that being no, then step S204 is performed.
Step S206, the element to be pulled moves to the container.
Can not be the situation of container in currentElement by the circular treatment of above-mentioned step S204 and step S205 Under, continue to obtain the other element of one-level higher, until getting as the element of container.By such Recursion process, can be with In all ancestral elements of the superiors' element determined by step S202, finding can be used as the unit of the lowest level of container Element, for current location, such lowest level element is most shallow depth, it is clear that will not also be hidden by other containers Gear, it is thus possible to avoid carrying out depth calculation process of the prior art, and the deterministic process whether container is blocked, carries The high performance and efficiency of respective handling.
It is further noted that in order to improve corresponding treatment mechanism, the technical side that the embodiment of the present invention is proposed Case also operates fallback mechanism comprising corresponding, specifically, in above-mentioned step S205, if performing the parent unit for judging Element is specially browser root node, and judged result be it is no, i.e. the browser root node nor during container, it is determined that being treated to described The drag operation failure of element is pulled, and the element to be pulled is returned into home position.
By such operation, the failure handling mechanism of drag operation can be introduced, it is ensured that the integrality of drag operation, Certainly, this is a kind of preferred technical scheme, if having no effect on protection scope of the present invention including the failure handling mechanism.
On the other hand, it should be pointed out that for above-mentioned step S203 and step S205, judge whether element is container Method, specifically include:
Current all containers are searched, judges whether the element is one of container.
In actual applications, because whether element is that container can pre-set, therefore, a kind of specific mode can be By the list of all containers storage local, it is determined that one is directly compared wait after the element for judging with corresponding list, Determine whether the element is some element in list, if it is, i.e. container list includes the element, it is determined that the element It is container, if it is not, no i.e. in container list include the element, it is determined that the element is not container.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, during web page element dragging, pulled according to web page element Target location coordinate information, determine the superiors' element that current web page element is dragged to, and in the superiors' element or When the superior node of the superiors' element is container, during the web page element moved into cell therefor, web page element is completed Pull, so that, it is to avoid the complicated calculations of all container positions and relevant parameter corresponding to position coordinates are determined in the prior art Process, and with the presence or absence of the deterministic process blocked, is to be capable of achieving the dragging of web page element and corresponding by simple algorithm The determination of container, improves the process performance and efficiency of the processing procedure that webpage is pulled.
Below, with reference to specific application scenarios, the technical scheme proposed to the embodiment of the present invention is illustrated.
For convenience of explanation, a kind of specific application scenarios are the embodiment of the invention provides, it is specific as shown in figure 3, working as In preceding webpage, there is element 1, element 2, element 3 and element 4, wherein, element 1 is the parent element of element 3, with webpage Can be determined by the positional information relative to the origin of coordinates as the origin of coordinates, each position information in webpage in the upper left corner Justice.
When needing to carry out drag operation to element 4(In the case, element 4 is foregoing element to be pulled), i.e., from When position A moves into place B, the element 4 in position A is locked by mouse first, then moved, move into place B Afterwards(Now mouse pointer is in position C), mouse discharges to element 4, now, obtains mouse position now(Position C) Coordinate information(X, y).
Browser provides an API:Document.elementFromPoint (x, y), wherein x, y are above-mentioned mouse The coordinate of the coordinate information of current position, i.e. coordinate points relative to the origin of coordinates defined in browser clients end regions is marked, According to corresponding API definition, after corresponding coordinate information is input into the API, the API can export most going up where the coordinate points Layer element, the influence in order to avoid element 4 to output result temporarily can hide element 4, show following element, and Therefrom determine the element of the superiors(It is of course also possible to use the other modes gone out given in step S202 determine unit of the superiors Element).
As shown in figure 3, the element residing for the coordinate points of position C includes element 3, element 1 and browser root node, by coordinate Information(X, y)After being input into the API as parameter, corresponding return value is the superiors' element where coordinate points(Element 3), and It is not the element 1 or browser root node of more lower.
All of container is searched, judges whether element 3 is certain container, if it is, during element 4 moved into element 3, It is specific as shown in Figure 4 A, wherein, the shape shown after moving of element 4 is as shown in dash area in figure.Now, element 4 is moved Container is moved for element 3, the depth of the element 3 is that depth is most shallow in each container residing for the coordinate points of position C, not any Other containers are blocked.
If element 3 is not container, the parent node of element 3, i.e. element 1 are obtained.
All of container is searched, judges whether element 1 is certain container, if it is, element 4 is moved into element 1 In, specifically as shown in Figure 4 B, wherein, the shape shown after moving of element 4 is as shown in dash area in figure.Now, the institute of element 4 Container is moved to for element 1, the depth of the element 1 is that depth is most shallow in each container residing for the coordinate points of position C(Element 1 Be the parent element of element 3, belong to inclusion relation, do not carry out depth ratio compared with), there is no any other container to block.
If element 1 is not container, continue to obtain the parent node of element 1, i.e. browser root node.
If browser root node is container, during element 4 moved into browser root node, specifically as shown in Figure 4 C, Wherein, the shape shown after moving of element 4 is as shown in dash area in figure.Now, element 4 moves to container for browser Root node, the depth of the browser root node is that depth is most shallow in each container residing for the coordinate points of position C(Browser root section Point is the parent node of element 1, and element 1 is the parent element of element 3, belongs to inclusion relation, therefore, do not carry out depth Compare), there is no any other container to block.
In the case of including operation fallback mechanism as the aforementioned, if browser node is nor container, directly true Drag operation failure before settled, home position is returned to by element 4, that is, return to scene as shown in Figure 3.
Above-mentioned various situations are respectively illustrated in current application scenarios, because whether specific each element is container The difference of caused result, wherein, because element 2 is not the element residing for the C of position, therefore, no matter element 2 is not It is container, all specific result is not influenceed,
Certainly, for specific application scenarios, because the tree of element has been pre-defined, so, above-mentioned father The determination mode of level element can be used real by simple Dom node visits function by browser script javascript It is existing.
In view of the simplification of concrete processing procedure, the embodiment of the invention provides above-mentioned is not container in specific element In the case of step by step upward recursion determine whether corresponding ancestral element is container(Since the element 3 for initially determining that, it is determined that After element is not container accordingly, upward recursion is made whether the judgement for container to the parent element of elements at different levels step by step), directly To certain ancestral element is found for container or reaching browser root node, in a program, above-mentioned scheme can be used Recursive algorithm is realized.
Certainly, if specific disposal ability is more powerful, it is also possible to all ancestral elements of direct access element 3, and Contrasted with specific container list, determine all containers in element 3 and its ancestral element, then, it is determined that lowest level The container that element is moved to by element 4, for example, in the case where element 3 and element 1 are container, because element 1 is element 3 parent element, rank is higher, so, determine the container that the lower element 3 of rank is moved to by element 4.Certainly, so Processing mode be actually also the another form of recursive algorithm for giving more powerful computational load, with above-mentioned technology The thinking of scheme is consistent, simply needs to consume more process resources, also belongs to protection scope of the present invention.
There is described above as can be seen that the advantage of the technical program is during whole realization, only need to be by one Secondary browser API's calls, along with a simple recursive algorithm is that the dragging for being capable of achieving web page element is processed, simple side Just, it is easy to use.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, during web page element dragging, pulled according to web page element Target location coordinate information, determine the superiors' element that current web page element is dragged to, and in the superiors' element or When the superior node of the superiors' element is container, during the web page element moved into cell therefor, web page element is completed Pull, so that, it is to avoid the complicated calculations of all container positions and relevant parameter corresponding to position coordinates are determined in the prior art Process, and with the presence or absence of the deterministic process blocked, is to be capable of achieving the dragging of web page element and corresponding by simple algorithm The determination of container, improves the process performance and efficiency of the processing procedure that webpage is pulled.
In order to realize the technical scheme of the embodiment of the present invention, the embodiment of the present invention additionally provides a kind of network equipment, specifically Structural representation as shown in figure 5, including:
Receiver module 51, for when receive will wait pull element be dragged to current location and release operational order when, Obtain the coordinate information of current location;
Determining module 52, for determining the seat corresponding to the coordinate information of the current location acquired in the receiver module 51 The superiors' element where punctuate;
Judge module 53, for judging whether element determined by the determining module 52 is container;
Processing module 54, during for the judged result in the judge module 53 to be, the element to be pulled is moved To in the container;
Wherein, the processing module 54 is additionally operable to, when the judged result of the judge module 53 is no, perform step A;
Step A, the parent element for obtaining the element that current judged result is no, then perform step B;
Step B, notify that the judge module 53 judges whether the parent element is container, if it is judged that be it is yes, During the element to be pulled moved into the container, if it is judged that being no, then step A is performed.
In specific treatment scene, the determining module 52, specifically for:
Obtain default API;
The coordinate information of the current location is input into the API;
The superiors' element where receiving the coordinate points corresponding to the coordinate information of the current location that the API is returned Information.
On the other hand, the processing module 54, specifically for:
By browser script javascript, the unit that current judged result is no is determined using Dom node visit functions The parent element of element.
In actual applications, the judge module 53, specifically for:
Current all containers are searched, judges that element determined by the determining module 52 or the processing module 54 are obtained Whether the element got is one of container.
It is further noted that the judge module 53, is additionally operable to:
When the element for being judged specially browser root node, and the browser root node are not container, it is determined that Drag operation failure to the element to be pulled, notifies that the element to be pulled is returned to raw bits by the processing module 54 Put.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, during web page element dragging, pulled according to web page element Target location coordinate information, determine the superiors' element that current web page element is dragged to, and in the superiors' element or When the superior node of the superiors' element is container, during the web page element moved into cell therefor, web page element is completed Pull, so that, it is to avoid the complicated calculations of all container positions and relevant parameter corresponding to position coordinates are determined in the prior art Process, and with the presence or absence of the deterministic process blocked, is to be capable of achieving the dragging of web page element and corresponding by simple algorithm The determination of container, improves the process performance and efficiency of the processing procedure that webpage is pulled.
Through the above description of the embodiments, those skilled in the art can be understood that the embodiment of the present invention Can be realized by hardware, it is also possible to realized by the mode of software plus necessary general hardware platform.Based on such reason Solution, the technical scheme of the embodiment of the present invention can be embodied in the form of software product, and the software product can be stored one Individual non-volatile memory medium(Can be CD-ROM, USB flash disk, mobile hard disk etc.)In, including some instructions are used to so that a meter Calculate machine equipment(Can be personal computer, server, or network equipment etc.)Perform each implement scene institute of the embodiment of the present invention The method stated.
It will be appreciated by those skilled in the art that accompanying drawing is a schematic diagram for being preferable to carry out scene, module in accompanying drawing or Flow is not necessarily implemented necessary to the embodiment of the present invention.
It will be appreciated by those skilled in the art that module in device in implement scene can according to implement scene describe into Row is distributed in the device of implement scene, it is also possible to carry out one or more dresses that respective change is disposed other than this implement scene In putting.The module of above-mentioned implement scene can merge into a module, it is also possible to be further split into multiple submodule.
The embodiments of the present invention are for illustration only, and the quality of implement scene is not represented.
Disclosed above is only several specific implementation scenes of the embodiment of the present invention, but, the embodiment of the present invention not office It is limited to this, the changes that any person skilled in the art can think of should all fall into the business limitation scope of the embodiment of the present invention.

Claims (10)

1. a kind of web page element dragging method, it is characterised in that methods described is specifically included:
When receiving when the operational order that element is dragged to current location and discharges is pulled, the coordinate for obtaining current location is believed Breath;The coordinate information is the identified relative position based on origin position defined in current web page region;
The superiors' element where determining the coordinate points corresponding to the coordinate information of the current location;The superiors' element is In removing the other elements outside element to be pulled, the superiors that the coordinate points corresponding to the coordinate information of current location are located at Element;
Judge whether the superiors' element is container;
If it is judged that being yes, during the element to be pulled moved into the container, if it is judged that being no, then perform Step A;
Step A, the parent element for obtaining the element that current judged result is no, then perform step B;
Step B, judge whether the parent element is container, if it is judged that being yes, the element to be pulled is moved to In the container, if it is judged that being no, then step A is performed.
2. the method for claim 1, it is characterised in that corresponding to the coordinate information of the determination current location The superiors' element where coordinate points, specifically includes:
Obtain default application programming interfaces API;
The coordinate information of the current location is input into the API;
The letter of the superiors' element where receiving the coordinate points corresponding to the coordinate information of the current location that the API is returned Breath.
3. the method for claim 1, it is characterised in that the parent unit of the element that the current judged result of acquisition is no Element, specifically includes:
By browser script javascript, current judged result is determined using DOM Document Object Model Dom node visit functions The parent element of the element for being no.
4. the method for claim 1, it is characterised in that judge element whether be container method, specifically include:
Current all containers are searched, judges whether the element is one of container.
5. the method for claim 1, it is characterised in that during judging whether element is container, also include:
When corresponding element is specially browser root node, and the browser root node is when being not container, it is determined that being treated to described The drag operation failure of element is pulled, the element to be pulled is returned into home position.
6. a kind of network equipment, it is characterised in that specifically include:
Receiver module, for when receiving when the operational order that element is dragged to current location and discharges is pulled, obtaining and working as The coordinate information of front position;The coordinate information is the identified phase based on origin position defined in current web page region To position;
Determining module, where for determining the coordinate points corresponding to the coordinate information of the current location acquired in the receiver module The superiors' element;The superiors' element is the coordinate letter of current location in removing the other elements outside element to be pulled The element of the superiors that the corresponding coordinate points of breath are located at;
Judge module, for judging whether element determined by the determining module is container;
Processing module, during for the judged result in the judge module to be, the appearance is moved to by the element to be pulled In device;
Wherein, the processing module is additionally operable to, when the judged result of the judge module is no, perform step A;
Step A, the parent element for obtaining the element that current judged result is no, then perform step B;
Step B, notify that the judge module judges whether the parent element is container, if it is judged that be it is yes, will be described Element to be pulled is moved in the container, if it is judged that being no, then performs step A.
7. the network equipment as claimed in claim 6, it is characterised in that the determining module, specifically for:
Obtain default API;
The coordinate information of the current location is input into the API;
The letter of the superiors' element where receiving the coordinate points corresponding to the coordinate information of the current location that the API is returned Breath.
8. the network equipment as claimed in claim 6, it is characterised in that the processing module, specifically for:
By browser script javascript, the element that current judged result is no is determined using Dom node visit functions Parent element.
9. the network equipment as claimed in claim 6, it is characterised in that the judge module, specifically for:
Current all containers are searched, element determined by the determining module or the unit accessed by the processing module is judged Whether element is one of container.
10. the network equipment as claimed in claim 6, it is characterised in that the judge module, is additionally operable to:
When the element for being judged specially browser root node, and the browser root node are not container, it is determined that to institute The drag operation failure of element to be pulled is stated, notifies that the element to be pulled is returned to home position by the processing module.
CN201110405826.2A 2011-12-08 2011-12-08 Web page element dragging method and device Active CN103164191B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110405826.2A CN103164191B (en) 2011-12-08 2011-12-08 Web page element dragging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110405826.2A CN103164191B (en) 2011-12-08 2011-12-08 Web page element dragging method and device

Publications (2)

Publication Number Publication Date
CN103164191A CN103164191A (en) 2013-06-19
CN103164191B true CN103164191B (en) 2017-07-11

Family

ID=48587316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110405826.2A Active CN103164191B (en) 2011-12-08 2011-12-08 Web page element dragging method and device

Country Status (1)

Country Link
CN (1) CN103164191B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885712B (en) * 2014-03-21 2017-08-15 小米科技有限责任公司 Webpage method of adjustment, device and electronic equipment
CN105743869A (en) * 2014-12-12 2016-07-06 阿里巴巴集团控股有限公司 CSRF (Cross-site Request Forgery) attack prevention method, web server and browser
CN106648282B (en) * 2015-10-30 2021-05-14 北京国双科技有限公司 Method and device for processing indexes in webpage
CN106528135A (en) * 2016-10-27 2017-03-22 中企动力科技股份有限公司 Method and apparatus for determining target component in webpage
CN106528730B (en) * 2016-10-27 2020-01-21 中企动力科技股份有限公司 Method and device for designing components in webpage
CN106775651B (en) * 2016-11-25 2020-10-09 广州酷狗计算机科技有限公司 Webpage element shifting method and device
CN106648319B (en) * 2016-12-19 2020-04-07 广州视源电子科技股份有限公司 Operation method and device for mind map
CN109213409A (en) * 2017-07-01 2019-01-15 武汉斗鱼网络科技有限公司 Assembly positioning method, storage medium, electronic equipment and system are pulled in webpage
CN109782983B (en) * 2017-11-13 2021-05-25 腾讯科技(深圳)有限公司 View layout adjustment method and device for application program interface
CN109739501A (en) * 2018-12-18 2019-05-10 北京字节跳动网络技术有限公司 The method, apparatus and electronic equipment of streaming effect are realized in absolute fix layout
CN111949264A (en) * 2020-07-09 2020-11-17 北京齐尔布莱特科技有限公司 Page element positioning method and mobile terminal
CN112965645B (en) * 2021-03-15 2022-07-29 中国平安财产保险股份有限公司 Page dragging method and device, computer equipment and storage medium
CN115220628B (en) * 2022-06-14 2023-12-15 深圳市优必选科技股份有限公司 Element dragging method and device, electronic equipment and storage medium
CN115098216B (en) * 2022-07-21 2024-04-23 四川长虹教育科技有限公司 Element dragging matching method based on midpoint distance judgment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1760841A (en) * 2004-10-15 2006-04-19 微软公司 System and method for making user interface elements visible
CN101261642A (en) * 2008-04-10 2008-09-10 深圳市迅雷网络技术有限公司 Method and device for regulating internet page layout
CN101546329A (en) * 2009-05-07 2009-09-30 山东中创软件商用中间件股份有限公司 Real-time website status monitoring technology supporting self-customization of user

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1760841A (en) * 2004-10-15 2006-04-19 微软公司 System and method for making user interface elements visible
CN101261642A (en) * 2008-04-10 2008-09-10 深圳市迅雷网络技术有限公司 Method and device for regulating internet page layout
CN101546329A (en) * 2009-05-07 2009-09-30 山东中创软件商用中间件股份有限公司 Real-time website status monitoring technology supporting self-customization of user

Also Published As

Publication number Publication date
CN103164191A (en) 2013-06-19

Similar Documents

Publication Publication Date Title
CN103164191B (en) Web page element dragging method and device
CN103389895B (en) A kind of generation method and system of front end page
US10762282B2 (en) Content rendering
CN107392842B (en) Image stylization processing method and device, computing equipment and computer storage medium
CN106776939A (en) A kind of image lossless mask method and system
CN102884526B (en) Display items display in application window
US20120110453A1 (en) Display of Image Search Results
US20160092566A1 (en) Clustering repetitive structure of asynchronous web application content
CN106874247A (en) A kind of report form generation method and device
CN109670101B (en) Crawler scheduling method and device, electronic equipment and storage medium
CN105302876A (en) Regular expression based URL filtering method
CN104809751B (en) The method and apparatus for generating event group evolution diagram
CN110309386B (en) Method and device for crawling web page
CN108762749B (en) System object diagram automatic generation method based on code analysis
CN107392316B (en) Network training method and device, computing equipment and computer storage medium
WO2015009188A1 (en) Systems and methods for automated generation of graphical user interfaces
CN109271145A (en) Fast regular method for customizing based on pythonQT and intelligent algorithm
CN110399063B (en) Method and device for viewing page element attributes
CN103077174A (en) Concurrent resource updating method and equipment
US10775966B2 (en) Customizable autocomplete option
CN106649315A (en) Method and device for processing path navigation
CN107784054B (en) Page publishing method and device
CN115525321A (en) Distributed task generation method, device, equipment and storage medium
CN105528370B (en) Page detection method and client
Richter et al. Receptive field refinement for convolutional neural networks reliably improves predictive performance

Legal Events

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