CN114327459A - Page processing method, page processing device, electronic equipment, page processing medium and program product - Google Patents

Page processing method, page processing device, electronic equipment, page processing medium and program product Download PDF

Info

Publication number
CN114327459A
CN114327459A CN202111618021.6A CN202111618021A CN114327459A CN 114327459 A CN114327459 A CN 114327459A CN 202111618021 A CN202111618021 A CN 202111618021A CN 114327459 A CN114327459 A CN 114327459A
Authority
CN
China
Prior art keywords
target text
coordinate information
position coordinate
mouse
page
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.)
Pending
Application number
CN202111618021.6A
Other languages
Chinese (zh)
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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology 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 Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202111618021.6A priority Critical patent/CN114327459A/en
Publication of CN114327459A publication Critical patent/CN114327459A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to a page processing method, a page processing device, an electronic device, a medium and a program product, which are applied to the technical field of computers, wherein the method comprises the following steps: acquiring a target text to be set in a page, and cloning elements corresponding to the target text to obtain DIV elements; wherein the DIV element does not respond to mouse events; and acquiring position coordinate information of the target text in the DIV element in the page, and displaying the target text according to the position coordinate information and the preset display style. The method and the device for setting the display style of the text can set the display style of the text under the condition of not invading the service, and can also set the display style of the text in the replaceable elements.

Description

Page processing method, page processing device, electronic equipment, page processing medium and program product
Technical Field
The present application relates to the field of computer technologies, and in particular, to a page processing method, an apparatus, an electronic device, a medium, and a program product.
Background
In Web services, there is often a need for special display of text. In the related art, the requirement of special display can be realized by adding a span label in the area to be displayed. Where the span tag is a inline tag of HTML (HyperText markup language) that is used to combine inline elements in a document. When a style is applied to a span label, a visual change is produced. However, adding span tags to HTML can cause traffic intrusion and is poor in maintainability. Also, no special display is possible for the replaceable elements.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the application provides a page processing method, a page processing device, an electronic device, a medium and a program product.
According to a first aspect of the present application, there is provided a page processing method, including:
acquiring a target text to be set in a page, and cloning an element corresponding to the target text to obtain a DIV element; wherein the DIV element does not respond to mouse events;
and acquiring position coordinate information of the target text in the DIV element in the page, and displaying the target text according to a preset display style according to the position coordinate information.
Optionally, the method further includes:
if a first mouse event aiming at a parent element of the target text is monitored, or a first mouse event aiming at a window element is monitored, updating the position of the target text;
wherein the first mouse event comprises: a scroll event or a resize event.
Optionally, the method further includes:
if a second mouse event aiming at the parent element of the target text is monitored, acquiring position coordinate information of a mouse and position coordinate information of the parent element of the target text;
determining whether to respond to the second mouse event according to the position coordinate information of the mouse and the position coordinate information of the parent element of the target text;
wherein the second mouse event comprises: a click event or a hover event.
Optionally, the determining whether to respond to the second mouse event according to the position coordinate information of the mouse and the position coordinate information of the parent element of the target text includes:
determining the relative position coordinate information of the mouse relative to the parent element of the target text according to the position coordinate information of the mouse and the position coordinate information of the parent element of the target text;
responding to the second mouse event if the relative position coordinate information is located in the area where the target text is located;
and if the relative position coordinate information is outside the area where the target text is located, not responding to the second mouse event.
Optionally, the method further includes:
setting a transparency attribute of the DIV element to 0 so that the DIV element is hidden in the page.
Optionally, the method further includes:
and deleting the DIV elements after the position coordinate information of the target text in the page in the DIV elements is obtained.
Optionally, the method further includes:
and responding to the trigger operation aiming at the target text, and displaying the expanded information corresponding to the target text.
Optionally, the page processing method is packaged in a software development kit SDK.
Optionally, the preset display style includes one or more of the following: font color, background color, underlining, boxing, font bolding, and text magnification.
Optionally, the elements corresponding to the target text include: an alternate type element.
According to a second aspect of the present application, there is provided a page processing apparatus including:
the element cloning module is used for acquiring a target text to be set in a page, and cloning elements corresponding to the target text to obtain DIV elements; wherein the DIV element does not respond to mouse events;
a text position information obtaining module, configured to obtain position information of the target text in the DIV element;
and the display style setting module is used for displaying the target text according to the position information and a preset display style.
Optionally, the page processing apparatus further includes:
the position updating module is used for updating the position of the target text if a first mouse event aiming at a parent element of the target text is monitored or a first mouse event aiming at a window element is monitored;
wherein the first mouse event comprises: a scroll event or a resize event.
Optionally, the page processing apparatus further includes:
the mouse and parent element position information acquisition module is used for acquiring the position information of the mouse and the position information of the parent element of the target text if a second mouse event aiming at the parent element of the target text is monitored;
the response judgment module is used for determining whether to respond to the second mouse event according to the position information of the mouse and the position information of the parent element of the target text;
wherein the second mouse event comprises: a click event or a hover event.
Optionally, the response determining module is specifically configured to determine, according to the position information of the mouse and the position information of the parent element of the target text, relative position information of the mouse with respect to the parent element of the target text; responding to the second mouse event if the relative position information is located in the area where the target text is located; and if the relative position information is outside the area where the target text is located, not responding to the second mouse event.
Optionally, the page processing apparatus further includes:
and the transparent attribute setting module is used for setting the transparent attribute of the DIV element to be 0 so as to hide the DIV element in the page.
Optionally, the page processing apparatus further includes:
and the DIV element deleting module is used for deleting the DIV element after the position coordinate information of the target text in the page in the DIV element is acquired.
Optionally, the page processing apparatus further includes:
and the extended information display module is used for responding to the trigger operation aiming at the target text and displaying the extended information corresponding to the target text.
Optionally, the page processing device is packaged in a software development kit SDK.
Optionally, the preset display style includes one or more of the following: font color, background color, underlining, boxing, font bolding, and text magnification.
Optionally, the elements corresponding to the target text include: an alternate type element.
According to a third aspect of the present application, there is provided an electronic device comprising: a processor for executing a computer program stored in a memory, the computer program, when executed by the processor, implementing the method of the first aspect.
According to a fourth aspect of the present application, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of the first aspect.
According to a fifth aspect of the present application, there is provided a computer program product which, when run on a computer, causes the computer to perform the method of the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
the DIV elements can be obtained by cloning the elements corresponding to the target text to be set. Because the DIV element has an interface for acquiring the text position coordinate information, the position coordinate information of the target text in the DIV element in the page can be acquired, and the position coordinate information is absolute position coordinate information. Thus, the target text can be displayed in a preset display style according to the position coordinate information. Since the DIV element does not respond to the mouse event, no impact is caused to the service. In addition, the DIV element can acquire the position coordinate information of the text in the replaceable element, so that the display style can be set for the text in the replaceable element.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a schematic diagram showing a system architecture of an exemplary application environment to which a page processing method of an embodiment of the present application can be applied;
FIG. 2A is a flowchart of a page processing method in an embodiment of the present application;
FIG. 2B is a flowchart illustrating a page processing method according to an embodiment of the present disclosure;
fig. 3 is a schematic view of a scene for displaying extended information corresponding to text information in an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a page processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order that the above-mentioned objects, features and advantages of the present application may be more clearly understood, the solution of the present application will be further described below. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, but the present application may be practiced in other ways than those described herein; it is to be understood that the embodiments described in this specification are only some embodiments of the present application and not all embodiments.
Fig. 1 is a schematic diagram showing a system architecture of an exemplary application environment to which a page processing method of an embodiment of the present application can be applied.
As shown in fig. 1, system architecture 100 may include one or more of terminal device 101, terminal device 102, terminal device 103, network 104, and server 105. Network 104 is the medium used to provide communication links between terminal device 101, terminal device 102, terminal device 103, and server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to desktop computers, portable computers, smart phones, tablet computers, and the like. It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The page processing method provided by the embodiment of the present application is generally executed by the server 105, and accordingly, the page processing apparatus may be disposed in the server 105. However, it is easily understood by those skilled in the art that the page processing method provided in the embodiment of the present application may also be executed by the terminal device 101, the terminal device 102, and the terminal device 103. For example, the terminal device 101, the terminal device 102, and the terminal device 103 may select a target text to be set in a page, and upload the target text to the server 105, and the server 105 displays the target text according to a preset display style based on the page processing method of the embodiment of the present application, and sends a display result to the terminal device 101, the terminal device 102, and the terminal device 103.
Referring to fig. 2A, fig. 2A is a flowchart of a page processing method in an embodiment of the present application, which may include the following steps:
step S210, acquiring a target text to be set in a page, and cloning elements corresponding to the target text to obtain DIV elements; wherein the DIV element does not respond to mouse events.
The target text may be text having special display requirements. For example, if the grammar of a certain text is to be corrected, and an underline is added to prompt an error, the text is the target text. The target text in the page has corresponding elements, the types of which include: replaceable elements and non-replaceable elements.
The replaceable element is that the browser determines the specific display content of the element according to the label and the attribute of the element. For example, the browser reads and displays picture information according to the value of the src attribute of the < img > tag, but does not see the actual content of the picture if viewing HTML code; further, for example, whether to display an input box or a radio button is determined based on the type attribute of the < input > tag. < img >, < input >, < textarea >, < select >, < object >, etc. in HTML are all replacement elements. These elements often have no actual content, i.e. are empty elements. The non-replaceable elements have their contents presented directly to the user side (e.g., browser). For example, the text of paragraph < p >, paragraph < p > is an irreplaceable element, and the text "the content of paragraph" is displayed in its entirety.
Currently, the display style of text in the replaceable element cannot be set. In this embodiment of the present application, a display style of a text in the replaceable element may be set, that is, a type of an element corresponding to the target text may include: an alternative element. For example, if the element corresponding to the target text belongs to a replaceable element (e.g., input, textarea, etc.), since the replaceable element does not have an interface function for acquiring a text position, the element corresponding to the target text may be cloned to obtain a DIV element, and the DIV element has an interface function for acquiring a text position. Thus, the position coordinate information of the target text in the page can be acquired through the DIV element. It should be noted that the page processing method in the embodiment of the present application is also applicable to the non-replaceable element. That is, DIV elements can also be cloned according to the above-described method.
In order to ensure the accuracy of cloning, that is, in order to make the positions of the element corresponding to the target text and the cloned DIV element the same, CSS (cascading style sheet) attributes related to the positions, such as margin, padding, border, font, and the like, may be acquired from the element corresponding to the target text, and the attributes of the DIV element may be set according to the acquired attributes.
To achieve non-intrusiveness into the traffic, the mouse event control switch pointer-events in the CSS attribute of the DIV element may be set to none. Therefore, the mouse event cannot be responded to when the display style of the target text is set, and the event response of the service cannot be influenced.
Step S220, acquiring position coordinate information of the target text in the DIV element in the page, and displaying the target text according to the position coordinate information and the preset display style.
Since the DIV element has the getBoundingClientRect function, the position coordinate information of the target text in the DIV element in the page can be acquired by using the getBoundingClientRect function. The getBoundingClientRect function can acquire the position coordinate information of a text in a specified range (start and end), and the position coordinate information of the target text in the page can be accurately calculated through the position coordinate information. The position coordinate information of the target text in the page can be absolute position coordinate information of the target text in the page, and non-invasion to the service is realized through the absolute position coordinate information. The absolute position coordinate information makes the position of the target text independent of the document stream and therefore does not take up space.
After the position coordinate information of the target text in the page is obtained, the target text can be displayed according to a preset display style. The preset display style may be a display style preset by a user according to actual needs, and the preset display style may include one or more of the following: font color, background color, underlining, and boxing.
The page processing method of the embodiment of the application can be packaged in an SDK (software development kit) to realize multiplexing of technologies. In this way, different services can quickly access the above functions, and different display styles can be customized.
According to the page processing method, the DIV elements can be obtained by cloning the elements corresponding to the target text to be set. Because the DIV element has an interface for acquiring the text position coordinate information, the position coordinate information of the target text in the DIV element in the page can be acquired, and the position coordinate information is absolute position coordinate information. Thus, the target text can be displayed in a preset display style according to the position coordinate information. Since the DIV element does not respond to the mouse event, no impact is caused to the service. In addition, the DIV element can acquire the position coordinate information of the text in the replaceable element, so that the display style can be set for the text in the replaceable element.
Referring to fig. 2B, fig. 2B is a flowchart of a page processing method in the embodiment of the present application, which may include the following steps:
step S310, acquiring a target text to be set in a page, and cloning elements corresponding to the target text to obtain DIV elements; wherein the DIV element does not respond to mouse events.
This step is the same as step S210 in the embodiment of fig. 2A, and specific reference may be made to the description in the embodiment of fig. 2A, which is not repeated herein.
In step S320, the transparent attribute of the DIV element is set to 0, so that the DIV element is hidden in the page.
In the embodiment of the application, the transparency of the DIV element is set, so that the user can be ensured to have no perception when the target text is displayed according to the preset display style, and the user experience can be improved.
Step S330, acquiring the position coordinate information of the target text in the DIV element in the page.
This step is the same as the manner of obtaining the position coordinate information of the target text in the DIV element in step S220 in the embodiment of fig. 2A, and specific reference may be made to the description in the embodiment of fig. 2A, which is not described herein again.
In step S340, if the first mouse event for the parent element of the target text is monitored, or the first mouse event for the window element is monitored, the position of the target text is updated.
It can be understood that, in the case that the user performs a sliding operation or a resizing operation in the page, the position of the target text in the page may also be changed, and the position of the target text may be updated synchronously in order to accurately display the target file according to the preset display style.
Specifically, the parent element of the target text and the window element may be monitored, and if the first mouse event for the parent element of the target text is monitored or the first mouse event for the window element is monitored, it is determined that the position of the target text is changed, and the position of the target text may be updated. The first mouse event refers to an event that can generate a change in the position of the target text, and includes: a scroll (scroll) event or a resize (resize) event, etc.
And step S350, displaying the target text according to the preset display style according to the position coordinate information of the target text.
This step is the same as the way of displaying the target text in step S220 in the embodiment of fig. 2A, and specific reference may be made to the description in the embodiment of fig. 2A, which is not repeated herein.
Step S360, if a second mouse event aiming at the parent element of the target text is monitored, acquiring the position coordinate information of the mouse and the position coordinate information of the parent element of the target text, and determining whether to respond to the second mouse event according to the position coordinate information of the mouse and the position coordinate information of the parent element of the target text.
In some cases, the accessed service requires that the target text be able to respond to a second mouse event, wherein the second mouse event may include: a click (click) event or a hover (hover) event. Therefore, a second mouse event of the parent element of the target text may be monitored, and if the second mouse event is monitored, the position coordinate information of the mouse may be acquired from the second mouse event object. And simultaneously recording the position coordinate information of the target text, comparing the position coordinate information of the mouse with the position coordinate information of the target text, and determining whether to respond to a second mouse event.
Since the target text is stored in relative coordinates with respect to the parent element of the target text, the acquired position coordinate information of the mouse is absolute position coordinate information. Therefore, when judging whether the mouse collides with the area where the target text is located, the position coordinate information of the mouse and the position coordinate information of the target text can be converted into the same reference object. For example, they may be both expressed as absolute position coordinate information and also may be both expressed as position coordinate information with respect to the parent element of the target text.
In an alternative embodiment, the relative position coordinate information of the mouse with respect to the parent element of the target text may be determined according to the position coordinate information of the mouse and the position coordinate information of the parent element of the target text. The position coordinate information of the parent element of the target text can also be acquired through a getbackingclientrect function. Optionally, the position coordinate information of the parent element of the target text may be subtracted from the position coordinate information of the mouse, and then the scroll distance of the target text in the page is added to obtain the relative position coordinate information of the mouse with respect to the parent element of the target text. Through verification and the rolling distance of the target text in the page, more accurate relative position coordinate information can be obtained.
Responding to a second mouse event if the relative position coordinate information is located in the area where the target text is located and indicates that the mouse clicks the area where the target text is located or the mouse hovers over the area where the target text is located; and if the relative position coordinate information is outside the area where the target text is located, not responding to the second mouse event.
Specifically, assuming that the region where the target text is located is a rectangle, the position of this rectangle can be recorded by four variables (left, top, width, height), that is, the position coordinate of the top left vertex of the rectangle and the width and height of the rectangle. Whether the relative position coordinate information of the mouse is in the area where the target text is located is determined by judging whether the relative position coordinate information (assumed to be x and y) of the mouse intersects with the rectangle. If the following conditions are satisfied: if x > left & & x & (left + width) & & y > (top + height), determining that the relative position coordinate information of the mouse is in the area where the target text is located; otherwise, determining that the relative position coordinate information of the mouse is outside the region where the target text is located.
It should be noted that the obtaining of the DIV element by cloning is to obtain the position coordinate information of the text in the DIV element, and therefore, after obtaining the position coordinate information of the target text and the position coordinate of the parent element of the target text, the DIV element may be deleted.
In the embodiment of the application, after the target text is displayed according to the preset display style, the user can also perform a trigger operation on the target text, and in response to the trigger operation on the target text, the extended information corresponding to the target text can be displayed. Wherein, the triggering operation executed on the target text can be a hovering operation, a clicking operation and the like; the extension information corresponding to the target text may be related introduction information of the target text, or other information associated with the target text, or the like.
Referring to fig. 3, fig. 3 is a scene schematic diagram illustrating extended information corresponding to text information in an embodiment of the present application. It can be seen that when a user hovers a mouse over the target text ASR, the relevant introduction information of the target text ASR, as well as the relevant cloud documents, can be displayed. In this way, the user can know the meaning of the ASR in time, and, with the intent of having more knowledge of the ASR, can view relevant cloud documents.
According to the webpage processing method, the transparent attribute of the cloned DIV element is set to be 0, so that a user can not perceive the webpage processing method when the webpage processing method is executed, and the user experience is improved. Since the DIV element does not respond to the mouse event, no impact is caused to the service. Because the DIV element has an interface for acquiring the position coordinate information of the text, the position coordinate information of the target text in the page in the DIV element can be acquired. When a first mouse event aiming at a parent element of the target text or a window element is monitored, the position coordinate of the target text changes, so that the position coordinate information of the target text can be updated in time, and the target text can be accurately displayed according to the preset display style according to the position coordinate information. In addition, the DIV element can acquire the position coordinate information of the text in the replaceable element, so that the display style can be set for the text in the replaceable element. When a second mouse event aiming at the parent element of the target text is monitored, the position coordinate information of the mouse is compared with the position coordinate information of the target text to determine whether to respond to the second mouse event so as to meet the general requirements of services.
Corresponding to the above method embodiment, an embodiment of the present application further provides a page processing apparatus, and referring to fig. 4, the page processing apparatus 400 includes:
the element cloning module 410 is configured to acquire a target text to be set in a page, and clone an element corresponding to the target text to obtain a DIV element; wherein the DIV element does not respond to mouse events;
a text position coordinate information obtaining module 420, configured to obtain position coordinate information of a target text in the DIV element in the page;
and a display style setting module 430, configured to display the target text according to the position coordinate information and according to a preset display style.
Optionally, the page processing apparatus 400 further includes:
the position updating module is used for updating the position of the target text if a first mouse event aiming at a parent element of the target text is monitored or a first mouse event aiming at a window element is monitored;
wherein the first mouse event comprises: a scroll event or a resize event.
Optionally, the page processing apparatus 400 further includes:
the mouse and parent element position coordinate information acquisition module is used for acquiring the position coordinate information of the mouse and the position coordinate information of the parent element of the target text if a second mouse event aiming at the parent element of the target text is monitored;
the response judgment module is used for determining whether to respond to a second mouse event according to the position coordinate information of the mouse and the position coordinate information of the parent element of the target text;
wherein the second mouse event comprises: a click event or a hover event.
Optionally, the response determining module is specifically configured to determine, according to the position coordinate information of the mouse and the position coordinate information of the parent element of the target text, relative position coordinate information of the mouse with respect to the parent element of the target text; responding to a second mouse event if the relative position coordinate information is located in the area where the target text is located; and if the relative position coordinate information is outside the area where the target text is located, not responding to the second mouse event.
Optionally, the page processing apparatus 400 further includes:
and the transparent attribute setting module is used for setting the transparent attribute of the DIV element to be 0 so as to hide the DIV element in the page.
Optionally, the page processing apparatus 400 further includes:
and the DIV element deleting module is used for deleting the DIV elements after the position coordinate information of the target text in the page in the DIV elements is acquired.
Optionally, the page processing apparatus 400 further includes:
and the extended information display module is used for responding to the trigger operation aiming at the target text and displaying the extended information corresponding to the target text.
Optionally, the page processing apparatus 400 is packaged in an SDK.
Optionally, the preset display style includes one or more of the following: font color, background color, underlining, and boxing.
Optionally, the types of the elements corresponding to the target text include: an alternative element.
The details of each module or unit in the above device have been described in detail in the corresponding method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In an exemplary embodiment of the present application, there is also provided an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the page processing method described above in the present exemplary embodiment.
Fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application. It should be noted that the electronic device 500 shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiments.
As shown in fig. 5, the electronic apparatus 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for system operation are also stored. The central processing unit 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a Local Area Network (LAN) card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program, when executed by the central processing unit 501, performs various functions defined in the apparatus of the present application.
In an embodiment of the present application, a computer-readable storage medium is further provided, on which a computer program is stored, and when the computer program is executed by a processor, the page processing method is implemented.
It should be noted that the computer readable storage medium shown in the present application can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, radio frequency, etc., or any suitable combination of the foregoing.
In an embodiment of the present application, a computer program product is further provided, which, when running on a computer, causes the computer to execute the above page processing method.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (14)

1. A page processing method, characterized in that the method comprises:
acquiring a target text to be set in a page, and cloning an element corresponding to the target text to obtain a DIV element; wherein the DIV element does not respond to mouse events;
and acquiring position coordinate information of the target text in the DIV element in the page, and displaying the target text according to a preset display style according to the position coordinate information.
2. The method of claim 1, further comprising:
if a first mouse event aiming at a parent element of the target text is monitored, or a first mouse event aiming at a window element is monitored, updating the position of the target text;
wherein the first mouse event comprises: a scroll event or a resize event.
3. The method of claim 1, further comprising:
if a second mouse event aiming at the parent element of the target text is monitored, acquiring position coordinate information of a mouse and position coordinate information of the parent element of the target text;
determining whether to respond to the second mouse event according to the position coordinate information of the mouse and the position coordinate information of the parent element of the target text;
wherein the second mouse event comprises: a click event or a hover event.
4. The method of claim 3, wherein determining whether to respond to the second mouse event based on the position coordinate information of the mouse and the position coordinate information of the parent element of the target text comprises:
determining the relative position coordinate information of the mouse relative to the parent element of the target text according to the position coordinate information of the mouse and the position coordinate information of the parent element of the target text;
responding to the second mouse event if the relative position coordinate information is located in the area where the target text is located;
and if the relative position coordinate information is outside the area where the target text is located, not responding to the second mouse event.
5. The method of claim 1, further comprising:
setting a transparency attribute of the DIV element to 0 so that the DIV element is hidden in the page.
6. The method of claim 1, further comprising:
and deleting the DIV elements after the position coordinate information of the target text in the page in the DIV elements is obtained.
7. The method of claim 1, further comprising:
and responding to the trigger operation aiming at the target text, and displaying the expanded information corresponding to the target text.
8. The method according to any one of claims 1 to 7, wherein the page processing method is encapsulated in a Software Development Kit (SDK).
9. The method according to any one of claims 1 to 7, wherein the preset display style comprises one or more of the following: font color, background color, underlining, and boxing.
10. The method according to any one of claims 1 to 7, wherein the type of the element corresponding to the target text comprises: an alternative element.
11. A page processing apparatus, characterized in that the apparatus comprises:
the element cloning module is used for acquiring a target text to be set in a page, and cloning elements corresponding to the target text to obtain DIV elements; wherein the DIV element does not respond to mouse events;
the text position coordinate information acquisition module is used for acquiring position coordinate information of the target text in the DIV element in the page;
and the display style setting module is used for displaying the target text according to the position coordinate information and a preset display style.
12. An electronic device, comprising: a processor for executing a computer program stored in a memory, the computer program, when executed by the processor, implementing the steps of the method of any of claims 1-10.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 10.
14. A computer program product, characterized in that it causes a computer to carry out the steps of the method according to any one of claims 1 to 10, when said computer program product is run on the computer.
CN202111618021.6A 2021-12-27 2021-12-27 Page processing method, page processing device, electronic equipment, page processing medium and program product Pending CN114327459A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111618021.6A CN114327459A (en) 2021-12-27 2021-12-27 Page processing method, page processing device, electronic equipment, page processing medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111618021.6A CN114327459A (en) 2021-12-27 2021-12-27 Page processing method, page processing device, electronic equipment, page processing medium and program product

Publications (1)

Publication Number Publication Date
CN114327459A true CN114327459A (en) 2022-04-12

Family

ID=81014784

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111618021.6A Pending CN114327459A (en) 2021-12-27 2021-12-27 Page processing method, page processing device, electronic equipment, page processing medium and program product

Country Status (1)

Country Link
CN (1) CN114327459A (en)

Similar Documents

Publication Publication Date Title
CN106570098B (en) Page refreshing method and device
US10460013B2 (en) Using server side font preparation to achieve WYSIWYG and cross platform fidelity on web based word processor
US8914496B1 (en) Tracking user behavior relative to a network page
US9519661B2 (en) Method and system for updating a background picture of a web search results page for different search queries
US20160275054A1 (en) Webpage display method and device
CN111783008B (en) Information display method, device, equipment and medium
AU2016256364B2 (en) Rendering graphical assets natively on multiple screens of electronic devices
CN111124564A (en) Method and device for displaying user interface
CN110764680A (en) Method and device for generating simulation keyboard, electronic equipment and computer readable medium
CN113656533A (en) Tree control processing method and device and electronic equipment
CN113076165A (en) Page checking method and device
US9501457B2 (en) Creating a communication editable in a browser independent of platform and operating system
US9875316B2 (en) Identifying user selection using coordinates and snapshots of webpages
CN113434138A (en) Information display method and device and electronic equipment
CN105183453A (en) Webpage-based information acquiring method and apparatus
CN114327459A (en) Page processing method, page processing device, electronic equipment, page processing medium and program product
CN112800373B (en) Webpage resource data generation method and device, computer equipment and storage medium
CN112507257B (en) Webpage display method, device, equipment and storage medium
CN110244948B (en) Method for switching button states based on programming language and electronic equipment
CN113918850A (en) Method for automatically correcting pattern, electronic equipment and storage medium
CN110187881B (en) Special-shaped window creation method, system, device and computer storage medium
US20160342570A1 (en) Document presentation qualified by conditions evaluated on rendering
WO2017119124A1 (en) Web page creation assistance device and storage medium
CN112947811A (en) Page navigation display method and device, electronic equipment and storage medium
US20140046773A1 (en) Method and system for displaying relevant advertisements based on characteristic tags

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination