CN108108113B - Webpage switching method and device - Google Patents

Webpage switching method and device Download PDF

Info

Publication number
CN108108113B
CN108108113B CN201711373495.2A CN201711373495A CN108108113B CN 108108113 B CN108108113 B CN 108108113B CN 201711373495 A CN201711373495 A CN 201711373495A CN 108108113 B CN108108113 B CN 108108113B
Authority
CN
China
Prior art keywords
page
browser
gesture operation
webpage
gesture
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
CN201711373495.2A
Other languages
Chinese (zh)
Other versions
CN108108113A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201711373495.2A priority Critical patent/CN108108113B/en
Publication of CN108108113A publication Critical patent/CN108108113A/en
Application granted granted Critical
Publication of CN108108113B publication Critical patent/CN108108113B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04883Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention discloses a webpage switching method and a device, wherein the method comprises the following steps: when the browser is in a foreground running state, if the fact that a user executes gesture operation on a currently opened page of the browser is detected, determining whether the currently opened page of the browser is a webpage or not; if so, determining whether a page element corresponding to the operation position of the gesture operation is provided with a response event corresponding to the gesture operation; and if the page element does not set a response event corresponding to the gesture operation, executing a webpage switching operation on a webpage currently opened by the browser according to the gesture operation. According to the method and the device, the user can execute gesture operation at any position on the webpage, the webpage switching is convenient for the user, the misoperation can be reduced, the normal response event of the webpage elements on the webpage cannot be influenced, and the webpage function abnormality cannot be caused.

Description

Webpage switching method and device
Technical Field
The invention relates to the technical field of mobile terminals, in particular to a webpage switching method and device.
Background
With the development of society, browsers become important channels for people to acquire various information, and therefore, the high-frequency usability of the browsers cannot be surpassed by other application programs. When a user browses a webpage by using a browser, the user often needs to move forward or backward to switch the webpage.
In the prior art, generally, a fixed area is set on a display screen, and a user performs gesture operation on the fixed area to switch web pages. However, sometimes the user may not find the range of the fixed area, the switching of the web page may not be realized, and even a malfunction may occur.
Disclosure of Invention
The embodiment of the invention aims to provide a webpage switching method and a webpage switching device, and aims to solve the problems that in the prior art, a gesture operation is executed in a fixed area of a display screen to switch a webpage, the switching of the webpage cannot be realized and even misoperation is generated possibly because a user cannot find the fixed area, the switching of the webpage can only be realized in the fixed area, and the normal event of the webpage in the fixed area cannot be responded, so that the function of the webpage in the fixed area is abnormal.
To solve the above technical problem, the embodiment of the present invention is implemented as follows:
in a first aspect, an embodiment of the present invention provides a method for switching web pages, where the method includes:
when a browser is in an open state, if it is detected that a user executes gesture operation on a currently opened page of the browser, determining whether the currently opened page of the browser is a webpage;
if so, determining whether a page element corresponding to the operation position of the gesture operation is provided with a response event corresponding to the gesture operation;
and if the page element does not set a response event corresponding to the gesture operation, executing a webpage switching operation on the webpage currently opened by the browser according to the gesture operation.
In a second aspect, an embodiment of the present invention further provides a web page switching apparatus, where the apparatus includes:
the browser comprises a first determining module, a second determining module and a display module, wherein the first determining module is used for determining whether a currently opened page of a browser is a webpage or not if detecting that a user executes gesture operation on the currently opened page of the browser when the browser is in a foreground running state;
the second determining module is used for determining whether a page element corresponding to the operation position of the gesture operation is provided with a response event corresponding to the gesture operation when the currently opened page of the browser is a webpage;
and the execution module is used for executing webpage switching operation on the webpage currently opened by the browser according to the gesture operation if the page element does not set the response event corresponding to the gesture operation.
In a third aspect, an embodiment of the present invention further provides a mobile terminal, including: a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the web page switching method according to the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements the steps of the web page switching method according to the first aspect.
In the embodiment of the invention, when the browser is in a foreground running state and gesture operation executed by a user on a currently opened page of the browser is detected, whether the currently opened page of the browser is a webpage or not is determined, and after the currently opened page of the browser is determined to be the webpage, when it is determined that a response event corresponding to the gesture operation is not set on a page element corresponding to a position where the gesture operation is executed, a webpage switching operation is executed according to the gesture operation.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of a first method of a web page switching method in an embodiment of the invention;
FIG. 2(a) is a schematic interface diagram of a web page of a browser for a user to perform a gesture in a web page switching method according to an embodiment of the present invention;
FIG. 2(b) is a schematic interface diagram illustrating a user performing a gesture operation at a page element on a web page of a browser in the web page switching method according to an embodiment of the present invention;
FIG. 2(c) is a schematic diagram of a page interface in which a user performs an external gesture operation at a page element on a web page of a browser in the web page switching method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a web page switching operation performed according to a gesture operation in the web page switching method according to an embodiment of the present invention;
FIG. 4 is a flow chart of a second method of a web page switching method in an embodiment of the invention;
FIG. 5 is a schematic structural diagram of a web page switching apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a mobile terminal in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a webpage switching method which is applied to a mobile terminal, when a user opens a browser to browse a webpage, the method provided by the embodiment of the invention can realize the switching of the webpage when the user executes gesture operation at any position on the webpage currently opened by the browser, such as forward moving, backward turning and the like of the webpage, and can not influence the normal response event of the webpage elements on the webpage.
Fig. 1 is a flowchart of a first method of a web page switching method according to an embodiment of the present invention, where the method shown in fig. 1 at least includes the following steps:
s102, when the browser is in a foreground running state, if the fact that a user executes gesture operation on a currently opened page of the browser is detected, determining whether the currently opened page of the browser is a webpage or not; if yes, go to step S104.
The user may perform a gesture operation at any position on the currently opened page of the browser, and the gesture operation may be a sliding operation.
In addition, the browser in the foreground operation state means that the browser is in an open state and is operated in the foreground, that is, a currently open page of the browser is being displayed on a display screen of the current mobile terminal.
For a browser, the contents displayed on the home page of the browser are all the contents stored locally in the mobile terminal, so the home page of the browser is not considered to be a web page. In the embodiment of the present invention, the detecting whether the currently opened page of the browser is a web page is substantially to detect whether the currently opened page of the browser is a top page, if the currently opened page of the browser is a top page, it is determined that the currently opened page of the browser is not a web page, and if the currently opened page of the browser is not a top page, it is determined that the currently opened page of the browser is a web page, and the specific detection process is as follows:
acquiring a page view corresponding to a currently opened page of a browser; judging whether the type of the page view is a web view WebView or not; and if so, determining that the currently opened page of the browser is a webpage.
In the embodiment of the invention, whether the page currently opened by the browser is a webpage is judged by acquiring the page view corresponding to the currently opened page of the browser and judging whether the type of the page view is WebView, and the judgment method is simple and convenient only by judging the type of the page view.
Generally, the type of the page view corresponding to the web page of the browser is WebView, and the other types of web page views are all non-web pages.
In the embodiment of the invention, if it is determined that the currently opened page of the browser is not a web page, and at this time, the gesture operation performed on the page by the user cannot trigger the execution of the web page switching operation, the execution instruction corresponding to the gesture operation may be executed.
For example, the currently opened page of the browser is not a web page, the user performs a rightward sliding operation on the page, and the execution instruction corresponding to the operation is to increase the page brightness, at this time, the mobile terminal executes the instruction to increase the page brightness.
If it is determined that the currently opened page of the browser is a web page, the following step S104 is further executed to determine whether the gesture operation performed by the user can trigger the web page switching operation.
The execution subject of the method provided by the embodiment of the invention is the browser.
And S104, determining whether a response event corresponding to the gesture operation is set in the page element corresponding to the operation position of the gesture operation.
The page element is provided with a response event corresponding to the gesture operation, which means that when the gesture operation is performed on the page, the mobile terminal can be triggered to perform some operation corresponding to the page element, for example, a connection address, a website and other contents corresponding to the page element are opened.
For example, in a specific embodiment, an interface schematic diagram of a web page currently opened by a browser is shown in fig. 2(a), if a user performs a sliding operation on a news recommendation bar on the web page to the left or to the right, and a specific operation position of the user is shown in fig. 2(b), since the news recommendation bar itself is provided with a response event corresponding to the sliding operation, that is, when the user performs the sliding operation on the news recommendation bar, news displayed by the news recommendation bar is changed, and an interface schematic diagram of a current web page of the browser after the user performs the sliding operation on the area is shown in fig. 2(c), and a second recommended news is displayed on the news recommendation bar.
In an embodiment of the present invention, the determining, in the step S104, whether a response event corresponding to the gesture operation is set in the page element corresponding to the operation position of the gesture operation specifically includes the following steps (1), (2), and (3):
(1) acquiring a first position coordinate of an operation position of the gesture operation under a display screen coordinate system;
(2) determining a corresponding page element at the operation position according to the first position coordinate;
(3) and judging whether the page element is provided with a response event corresponding to the gesture operation through the page element control corresponding to the page element.
In the embodiment of the invention, the page element corresponding to the operation position is determined according to the position coordinate of the operation position operated by the gesture, the page element corresponding to the operation position is determined according to the coordinate value, the determination accuracy is higher, and the deviation is not easy to occur.
The display screen coordinate system is a coordinate system established by taking any one of four corners of a display screen of the mobile terminal as an origin and taking edges of two display screens forming the corner as a horizontal axis and a vertical axis respectively.
The page elements can be characters, pictures, link addresses and the like.
Specifically, in the embodiment of the present invention, when the browser determines that the current page is a web page, the gesture operation performed by the user on the current page and the first position coordinate of the gesture operation are sent to the WebView layer of the browser, and then sent to the browser kernel through the WebView layer, and the browser kernel determines the page element corresponding to the first position coordinate. And when the page element corresponding to the first position coordinate is determined, determining a page element control corresponding to the page element, and judging whether the page element is provided with response time corresponding to the gesture operation or not through the page element control.
And if the page element at the first position coordinate is provided with a response event corresponding to the gesture operation, executing the response event corresponding to the page element. In this case, the execution of the web page switching operation is not triggered.
In the embodiment of the invention, by judging whether the page element is provided with the response event corresponding to the operation gesture, if the page element is provided with the response event corresponding to the operation gesture, the gesture operation executed by the user at the position corresponding to the page element only triggers the response event corresponding to the page element, so that the normal response event on the webpage is not influenced, and the function abnormality of the webpage is not caused.
And if the page element at the first position coordinate does not set a response event corresponding to the gesture operation, sending the gesture operation and the first position coordinate of the gesture operation back to the browser kernel again, and executing the following step S106.
And S106, executing webpage switching operation according to the gesture operation.
In the embodiment of the present invention, the web page switching operation may be a web page forward/backward operation.
Fig. 3 is a flowchart illustrating a method for performing a web page switching operation according to the gesture operation in the embodiment of the present invention, where the method illustrated in fig. 3 at least includes the following steps:
s302, acquiring operation information of gesture operation;
s304, judging whether the operation information is matched with a preset operation rule or not; if yes, go to step S306;
and S306, executing webpage switching operation according to the switching instruction corresponding to the matched preset operation rule.
In the embodiment of the present invention, the gesture operation may be a sliding operation, a pressing operation, or the like.
When the gesture operation is a sliding operation, the gesture operation includes information such as a direction along which the gesture of the user slides, a distance along which the gesture slides, and the like.
In the embodiment of the present invention, specifically, the web page switching operation executed according to the gesture operation is executed by a gesture processing layer of the browser, and the browser kernel converts the gesture operation and the first position coordinate to the gesture processing layer.
Specifically, the acquiring operation information of the gesture operation specifically includes: performing coordinate conversion on a first position coordinate of the operation position of the gesture operation under a display screen coordinate system to obtain a second position coordinate of the gesture operation under a gesture recognition coordinate system; and determining the sliding direction and the sliding distance of the gesture operation according to the second position coordinate.
The gesture recognition coordinate system refers to a gesture processing layer coordinate system of the browser.
Specifically, the sliding direction may be a horizontal rightward sliding, a horizontal leftward sliding, a vertical downward sliding, or the like.
If the gesture operation of the user is a tilt slide, the gesture operation may be divided into a horizontal slide and a vertical slide, and the tilt angle of the tilt slide may be determined according to the horizontal slide distance and the vertical slide distance.
In the embodiment of the invention, the operation information of the gesture operation is determined according to the position coordinate of the gesture operation executed by the user, so that the sliding distance and the sliding direction of the gesture operation can be more accurately determined, and the gesture operation identification accuracy is higher in the embodiment of the invention.
Specifically, in the step S304, determining whether the operation information matches a preset operation rule includes:
and judging whether the sliding direction of the gesture operation is consistent with the operation direction of a preset operation rule or not, and judging whether the sliding distance of the gesture operation is matched with the sliding distance of the preset operation rule or not.
In the embodiment of the present invention, the preset operation rule may include a plurality of different operation rules, and one operation rule corresponds to one web page switching instruction.
For example, the gesture operation performed by the user on the webpage of the browser is rightward sliding for 3 centimeters, after the operation information corresponding to the gesture operation of the user is acquired, the preset operation rule of rightward sliding for 3 centimeters is found out from the preset operation rules, and if the webpage switching instruction corresponding to the preset operation rule of rightward sliding for 3 centimeters is page backward, the browser performs a page backward operation.
In one embodiment, if the difference between the sliding distance of the gesture operation and the sliding distance of the preset operation rule is within the preset range, the sliding distance of the gesture operation and the sliding distance of the preset operation rule may be considered to match.
When the user performs the gesture operation on the web page of the browser, the user may not accurately grasp the sliding distance of the user when performing the gesture operation on the web page, and therefore, the sliding distance in the preset operation rule may be a preset distance range, and as long as the sliding direction of the user when performing the gesture operation is consistent with the preset operation rule and the sliding distance of the user when performing the gesture operation is within the preset distance range corresponding to the preset operation rule, it is determined that the gesture operation is matched with the preset operation rule.
In the embodiment of the invention, the operation gesture of the user is set as the sliding operation, so that the user can conveniently execute the operation with one hand when browsing the page, and the switching operation of the page is carried out through the sliding operation, thereby being more in line with the use habit of the user.
Fig. 4 shows a flowchart of a second method of a web page switching method according to an embodiment of the present invention, where the method shown in fig. 4 at least includes the following steps:
s402, when the browser is in a foreground running state, detecting whether a user executes gesture operation on a currently opened page of the browser; if yes, go to step S404;
s404, detecting whether the currently opened page of the browser is a webpage; if yes, go to step S406;
s406, sending the gesture operation executed by the user and the position coordinate of the gesture operation in the display screen coordinate system to a WebView layer of the browser;
s408, the WebView layer of the browser sends the gesture operation and the position coordinates of the gesture operation under the display screen coordinate system to a browser kernel;
s410, the browser kernel determines a page element corresponding to the operation position of the gesture operation according to the position coordinate of the gesture operation;
s412, judging whether the page element is provided with a response event corresponding to the gesture operation through the page element control corresponding to the page element; if yes, go to step S414, otherwise go to step S420;
s414, the browser kernel sends the gesture operation and the position coordinate of the gesture operation under the display screen coordinate system to a gesture processing layer of the browser, and the gesture processing layer of the browser obtains the sliding direction and the sliding distance of the gesture operation;
s416, judging whether the sliding direction of the gesture operation is consistent with the operation direction of the operation of a preset operation rule, and judging whether the sliding distance of the gesture operation is matched with the sliding distance of the preset operation rule; if yes, go to step S418;
s418, executing webpage switching operation on the webpage currently opened by the browser according to a switching instruction corresponding to the preset operation rule matched with the gesture operation;
and S420, executing the response event corresponding to the page element.
According to the webpage switching method provided by the embodiment of the invention, when the browser is in the foreground running state and gesture operation executed by a user on the currently opened webpage of the browser is detected, whether the currently opened webpage of the browser is the webpage or not is determined, and after the currently opened webpage of the browser is determined to be the webpage, when the corresponding page element at the position where the gesture operation is executed is determined not to be provided with the response event corresponding to the gesture operation, the webpage switching operation is executed according to the gesture operation.
Based on the same idea as the method provided in the foregoing embodiment, an embodiment of the present invention further provides a web page switching apparatus, which is applied to a mobile terminal and is configured to execute the web page switching method provided in the embodiment of the present invention, and fig. 5 shows a schematic structural diagram of the web page switching apparatus provided in the embodiment of the present invention, and specifically includes:
the first determining module 51 is configured to, when the browser is in a foreground operating state, determine whether a currently opened page of the browser is a web page if it is detected that a user performs a gesture operation on the currently opened page of the browser;
a second determining module 52, configured to determine, when a currently opened page of the browser is a web page, whether a page element corresponding to an operation position of the gesture operation is provided with a response event corresponding to the gesture operation;
the executing module 53 is configured to, if no response event corresponding to the gesture operation is set in the page element, execute a web page switching operation on a web page currently opened by the browser according to the gesture operation.
Optionally, the first determining module 51 includes:
the first acquisition unit is used for acquiring a page view corresponding to a currently opened page of the browser;
the first judging unit is used for judging whether the type of the page view is a web view WebView or not;
and the first determining unit is used for determining that the currently opened page of the browser is a webpage when the type of the page view is WebView.
Optionally, the second determining module 52 includes:
the second acquisition unit is used for acquiring a first position coordinate of the operation position of the gesture operation under a display screen coordinate system;
the second determining unit is used for determining the corresponding page element at the operation position according to the first position coordinate;
and the second judging unit is used for judging whether the page element is provided with a response event corresponding to the gesture operation or not through the page element control corresponding to the page element.
Optionally, the executing module 53 includes:
a third acquisition unit, configured to acquire operation information of a gesture operation;
the third judging unit is used for judging whether the operation information is matched with the preset operation rule or not;
and the execution unit is used for executing the webpage switching operation according to the switching instruction corresponding to the matched preset operation rule when the operation information is matched with the preset operation rule.
Optionally, the third obtaining unit includes:
the conversion subunit is used for performing coordinate conversion on a first position coordinate of the operation position of the gesture operation in a display screen coordinate system to obtain a second position coordinate of the gesture operation in a gesture recognition coordinate system of the browser;
and the determining subunit is used for determining the sliding direction and the sliding distance of the gesture operation according to the second position coordinate.
Optionally, the third determining unit includes:
and the judging subunit is used for judging whether the sliding direction of the gesture operation is consistent with the operation direction of the preset operation rule or not and judging whether the sliding distance of the gesture operation is matched with the sliding distance of the preset operation rule or not.
Optionally, the executing module 53 is further configured to,
and if the page element is provided with a response event corresponding to the gesture operation, executing the response event corresponding to the page element.
According to the page switching device provided by the embodiment of the invention, when the browser is in the foreground running state and gesture operation executed by a user on the currently opened page of the browser is detected, whether the currently opened page of the browser is a webpage or not is determined, and after the currently opened page of the browser is determined to be the webpage, when the corresponding page element at the position where the gesture operation is executed is determined not to be provided with the response event corresponding to the gesture operation, the webpage switching operation is executed according to the gesture operation.
Fig. 6 is a schematic diagram of a hardware structure of a mobile terminal according to various embodiments of the present invention. The mobile terminal 600 shown in fig. 6 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 6 is not intended to be limiting of mobile terminals, and that a mobile terminal may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the mobile terminal includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
In an embodiment of the present invention, a computer program is stored in the memory 609, and when the computer program is executed by the processor 610, the following steps can be implemented:
when the browser is in a foreground running state, if the fact that a user executes gesture operation on a currently opened page of the browser is detected, determining whether the currently opened page of the browser is a webpage or not;
if so, determining whether a page element corresponding to the operation position of the gesture operation is provided with a response event corresponding to the gesture operation;
and if the page element does not set a response event corresponding to the gesture operation, executing a webpage switching operation on a webpage currently opened by the browser according to the gesture operation.
Optionally, the computer program, when executed by the processor 610, determines whether the page currently opened by the browser is a web page, including:
acquiring a page view corresponding to a currently opened page of a browser;
judging whether the type of the page view is a web view WebView or not;
and if so, determining that the currently opened page of the browser is a webpage.
Optionally, when the computer program is executed by the processor 610, the determining whether the page element corresponding to the operation position of the gesture operation has the response event corresponding to the gesture operation includes:
acquiring a first position coordinate of an operation position of the gesture operation under a display screen coordinate system;
determining a corresponding page element at the operation position according to the first position coordinate;
and judging whether the page element is provided with a response event corresponding to the gesture operation or not through a page element control corresponding to the page element.
Optionally, when executed by the processor 610, the computer program performs a web page switching operation according to the gesture operation, including:
acquiring operation information of the gesture operation;
judging whether the operation information is matched with a preset operation rule or not;
and if so, executing the webpage switching operation according to the switching instruction corresponding to the matched preset operation rule.
Optionally, when executed by the processor 610, the computer program obtains operation information of the gesture operation, including:
performing coordinate conversion on a first position coordinate of the operation position of the gesture operation under a display screen coordinate system to obtain a second position coordinate of the gesture operation under a gesture recognition coordinate system;
and determining the sliding direction and the sliding distance of the gesture operation according to the second position coordinate.
Optionally, when the computer program is executed by the processor 610, the determining whether the operation information matches the preset operation rule includes:
and judging whether the sliding direction of the gesture operation is consistent with the operation direction of the preset operation rule or not, and judging whether the sliding distance of the gesture operation is matched with the sliding distance of the preset operation rule or not.
Optionally, when the computer program is executed by the processor 610, if the page element has a response event corresponding to the gesture operation, the response event corresponding to the page element is executed.
According to the mobile terminal provided by the embodiment of the invention, when the browser is in the foreground running state and gesture operation executed by a user on the currently opened page of the browser is detected, whether the currently opened page of the browser is a webpage or not is determined, and after the currently opened page of the browser is determined to be the webpage, when the corresponding page element at the position where the gesture operation is executed is determined not to have the response event corresponding to the gesture operation, the webpage switching operation is executed according to the gesture operation.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 601 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 610; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 601 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. Further, the radio frequency unit 601 may also communicate with a network and other devices through a wireless communication system.
The mobile terminal provides the user with wireless broadband internet access through the network module 602, such as helping the user send and receive e-mails, browse webpages, access streaming media, and the like.
The audio output unit 603 may convert audio data received by the radio frequency unit 601 or the network module 602 or stored in the memory 609 into an audio signal and output as sound. Also, the audio output unit 603 may also provide audio output related to a specific function performed by the mobile terminal 600 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 603 includes a speaker, a buzzer, a receiver, and the like.
The input unit 604 is used to receive audio or video signals. The input Unit 604 may include a Graphics Processing Unit (GPU) 6041 and a microphone 6042, and the Graphics processor 6041 processes image data of a still picture or video obtained by an image capturing apparatus (such as a camera) in a video capture mode or an image capture mode. The processed image frames may be displayed on the display unit 606. The image frames processed by the graphic processor 6041 may be stored in the memory 609 (or other storage medium) or transmitted via the radio frequency unit 601 or the network module 602. The microphone 6042 can receive sound, and can process such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 601 in case of the phone call mode.
The mobile terminal 600 also includes at least one sensor 605, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 6061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 6061 and/or the backlight when the mobile terminal 600 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 605 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 606 is used to display information input by the user or information provided to the user. The Display unit 606 may include a Display panel 6061, and the Display panel 6061 may be configured by a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 607 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 607 includes a touch panel 6071 and other input devices 6072. Touch panel 6071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 6071 using a finger, stylus, or any suitable object or accessory). The touch panel 6071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 610, receives a command from the processor 610, and executes the command. In addition, the touch panel 6071 can be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The user input unit 607 may include other input devices 6072 in addition to the touch panel 6071. Specifically, the other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a track ball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 6071 can be overlaid on the display panel 6061, and when the touch panel 6071 detects a touch operation on or near the touch panel 6071, the touch operation is transmitted to the processor 610 to determine the type of the touch event, and then the processor 610 provides a corresponding visual output on the display panel 6061 according to the type of the touch event. Although the touch panel 6071 and the display panel 6061 are shown in fig. 6 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 6071 and the display panel 6061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 608 is an interface through which an external device is connected to the mobile terminal 600. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 608 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 600 or may be used to transmit data between the mobile terminal 600 and the external device.
The memory 609 may be used to store software programs as well as various data. The memory 609 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 609 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 610 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 609 and calling data stored in the memory 609, thereby integrally monitoring the mobile terminal. Processor 610 may include one or more processing units; preferably, the processor 610 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 610.
The mobile terminal 600 may further include a power supply 611 (e.g., a battery) for supplying power to the various components, and preferably, the power supply 611 is logically connected to the processor 610 via a power management system, so that functions of managing charging, discharging, and power consumption are performed via the power management system.
In addition, the mobile terminal 600 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides a mobile terminal, which includes a processor 610, a memory 609, and a computer program stored in the memory 609 and capable of running on the processor 610, where the computer program, when executed by the processor 610, implements each process of the foregoing embodiment of the web page switching method, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
Further, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the foregoing embodiment of the web page switching method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should also be noted that 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 like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present invention, and is not intended to limit the present invention. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (10)

1. A webpage switching method is applied to a mobile terminal, and is characterized by comprising the following steps:
when a browser is in a foreground running state, if it is detected that a user executes gesture operation on a currently opened page of the browser, determining whether the currently opened page of the browser is a webpage except a browser home page;
if so, determining whether a page element corresponding to the operation position of the gesture operation is provided with a response event corresponding to the gesture operation;
if the page element does not set a response event corresponding to the gesture operation, executing a webpage switching operation on a webpage currently opened by the browser according to the gesture operation;
if the page element is provided with a response event corresponding to the gesture operation, executing the response event corresponding to the page element;
the determining whether a page element corresponding to the operation position of the gesture operation is provided with a response event corresponding to the gesture operation includes: acquiring a first position coordinate of an operation position of the gesture operation in a display screen coordinate system; determining a corresponding page element at the operation position according to the first position coordinate; and judging whether the page element is provided with a response event corresponding to the gesture operation or not through a page element control corresponding to the page element.
2. The method of claim 1, wherein determining whether the page currently opened by the browser is a web page comprises:
acquiring a page view corresponding to a currently opened page of the browser;
judging whether the type of the page view is a web view WebView or not;
and if so, determining that the currently opened page of the browser is a webpage.
3. The method according to claim 1, wherein the performing a web page switching operation according to the gesture operation comprises:
acquiring operation information of the gesture operation;
judging whether the operation information is matched with a preset operation rule or not;
and if so, executing the webpage switching operation according to the switching instruction corresponding to the matched preset operation rule.
4. The method according to claim 3, wherein the obtaining operation information of the gesture operation comprises:
performing coordinate conversion on a first position coordinate of the operation position of the gesture operation in a display screen coordinate system to obtain a second position coordinate of the gesture operation in a gesture recognition coordinate system;
and determining the sliding direction and the sliding distance of the gesture operation according to the second position coordinate.
5. A webpage switching device is applied to a mobile terminal, and is characterized by comprising:
the browser comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining whether a currently opened page of a browser is a webpage except a browser home page or not if detecting that a user executes gesture operation on the currently opened page of the browser when the browser is in a foreground running state;
the second determining module is used for determining whether a page element corresponding to the operation position of the gesture operation is provided with a response event corresponding to the gesture operation when the currently opened page of the browser is a webpage;
the execution module is used for executing webpage switching operation on a webpage currently opened by the browser according to the gesture operation if the page element does not set a response event corresponding to the gesture operation;
the execution module is further configured to execute a response event corresponding to the page element if the page element is provided with the response event corresponding to the gesture operation;
the second determining module includes: the second acquisition unit is used for acquiring a first position coordinate of an operation position of the gesture operation in a display screen coordinate system; the second determining unit is used for determining the corresponding page element at the operating position according to the first position coordinate; and the second judging unit is used for judging whether the page element is provided with a response event corresponding to the gesture operation through the page element control corresponding to the page element.
6. The apparatus of claim 5, wherein the first determining module comprises:
the first acquisition unit is used for acquiring a page view corresponding to a currently opened page of the browser;
the first judging unit is used for judging whether the type of the page view is a web view WebView or not;
and the first determining unit is used for determining that the currently opened page of the browser is a webpage when the type of the page view is WebView.
7. The apparatus of claim 5, wherein the execution module comprises:
a third obtaining unit, configured to obtain operation information of the gesture operation;
the third judging unit is used for judging whether the operation information is matched with a preset operation rule or not;
and the execution unit is used for executing the webpage switching operation according to the switching instruction corresponding to the matched preset operation rule when the operation information is matched with the preset operation rule.
8. The apparatus of claim 7, wherein the third obtaining unit comprises:
the conversion subunit is used for performing coordinate conversion on a first position coordinate of the operation position of the gesture operation in a display screen coordinate system to obtain a second position coordinate of the gesture operation in a gesture recognition coordinate system of the browser;
and the determining subunit is used for determining the sliding direction and the sliding distance of the gesture operation according to the second position coordinate.
9. A mobile terminal, comprising: memory, processor and computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the web page switching method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the web page switching method according to any one of claims 1 to 4.
CN201711373495.2A 2017-12-19 2017-12-19 Webpage switching method and device Active CN108108113B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711373495.2A CN108108113B (en) 2017-12-19 2017-12-19 Webpage switching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711373495.2A CN108108113B (en) 2017-12-19 2017-12-19 Webpage switching method and device

Publications (2)

Publication Number Publication Date
CN108108113A CN108108113A (en) 2018-06-01
CN108108113B true CN108108113B (en) 2020-02-18

Family

ID=62210195

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711373495.2A Active CN108108113B (en) 2017-12-19 2017-12-19 Webpage switching method and device

Country Status (1)

Country Link
CN (1) CN108108113B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109782981A (en) * 2018-12-25 2019-05-21 北京字节跳动网络技术有限公司 A kind of page jump triggering method, device and computer storage medium
CN113050863A (en) * 2019-12-27 2021-06-29 腾讯科技(深圳)有限公司 Page switching method and device, storage medium and electronic equipment
CN112051962A (en) * 2020-09-10 2020-12-08 中国工商银行股份有限公司 Page switching method, device, equipment and storage medium
CN113891160B (en) * 2021-09-22 2024-02-13 百果园技术(新加坡)有限公司 Sliding switching method and device for content card, terminal and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929941A (en) * 2012-09-29 2013-02-13 四川长虹电器股份有限公司 Sliding loading method for Web page based on Android platform browser
CN103809843A (en) * 2012-11-08 2014-05-21 腾讯科技(深圳)有限公司 Method and device for adjusting brightness of display screen in browser

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5768457B2 (en) * 2011-04-19 2015-08-26 ソニー株式会社 Electronic device, display method and program
CN103324403B (en) * 2012-03-22 2015-11-04 腾讯科技(深圳)有限公司 page switching method, device and mobile terminal
CN104199603B (en) * 2014-08-28 2017-11-07 北京金山安全软件有限公司 Browser webpage control method and device and terminal
CN105892894B (en) * 2015-09-09 2020-08-11 北京奇虎科技有限公司 Method and device for processing screen sliding event conflict
CN105653586A (en) * 2015-12-21 2016-06-08 北京奇虎科技有限公司 Method and device for switching webpages in browser labels

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929941A (en) * 2012-09-29 2013-02-13 四川长虹电器股份有限公司 Sliding loading method for Web page based on Android platform browser
CN103809843A (en) * 2012-11-08 2014-05-21 腾讯科技(深圳)有限公司 Method and device for adjusting brightness of display screen in browser

Also Published As

Publication number Publication date
CN108108113A (en) 2018-06-01

Similar Documents

Publication Publication Date Title
CN108762954B (en) Object sharing method and mobile terminal
CN108182043B (en) Information display method and mobile terminal
CN108536365B (en) Image sharing method and terminal
CN108073343B (en) display interface adjusting method and mobile terminal
CN111142991A (en) Application function page display method and electronic equipment
CN109032486B (en) Display control method and terminal equipment
CN108897473B (en) Interface display method and terminal
CN111142723B (en) Icon moving method and electronic equipment
CN109710349B (en) Screen capturing method and mobile terminal
US11354017B2 (en) Display method and mobile terminal
CN109800045B (en) Display method and terminal
CN110531915B (en) Screen operation method and terminal equipment
CN108108113B (en) Webpage switching method and device
CN109343788B (en) Operation control method of mobile terminal and mobile terminal
CN107728923B (en) Operation processing method and mobile terminal
CN109407949B (en) Display control method and terminal
CN108062194B (en) Display method and device and mobile terminal
CN108958593B (en) Method for determining communication object and mobile terminal
CN110096203B (en) Screenshot method and mobile terminal
CN109710130B (en) Display method and terminal
CN109144393B (en) Image display method and mobile terminal
CN108196781B (en) Interface display method and mobile terminal
CN110795002A (en) Screenshot method and terminal equipment
CN110795021B (en) Information display method and device and electronic equipment
CN109597546B (en) Icon processing method and terminal equipment

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
GR01 Patent grant
GR01 Patent grant