Disclosure of Invention
The embodiment of the invention aims to provide a document page jumping method and device, so as to simplify user operation and improve user experience.
In order to achieve the above object, the embodiment of the present invention discloses a document page skipping method, which is applied to an electronic document, and the method includes:
displaying a progress bar and a skip page number input box in a current document page;
if the sliding block on the progress bar is dragged, obtaining the dragged final position of the sliding block in the progress bar;
displaying the page number corresponding to the final position in the skip page number input box according to the corresponding relation between the preset progress bar position and the document page number;
if the page number input by the user in the skip page number input box is received, moving the sliding block to the position corresponding to the page number according to the corresponding relation between the preset progress bar position and the document page number;
and receiving a user jump instruction, and jumping the document to a page corresponding to the page number in the jump page number input box.
Optionally, the step of displaying the progress bar and the skip page number input box in the current document page includes:
and continuously arranging the progress bar and the skip page number input box and displaying the progress bar and the skip page number input box in a preset area of the current document page.
Optionally, the correspondence between the preset position and the page number includes:
dividing the progress bar into subsections equal to the total number of the page numbers in advance according to the total number of the page numbers, wherein each subsection corresponds to one page number;
the step of displaying the page number corresponding to the final position in the skip page number input box according to the corresponding relation between the preset progress bar position and the document page number comprises the following steps:
determining a first sub-section to which the final position belongs;
and displaying the page number corresponding to the first subsection in the jump page number input box.
Optionally, the step of, according to the total number of pages, dividing the progress bar into subsections equal to the total number of pages, and each subsection corresponds to one page number includes:
dividing the length of the progress bar into subsections equal to the total number of pages in advance according to the total number of the pages, and correspondingly storing the initial position and the end position of each subsection with one page according to the sequence of the pages from small to large;
the step of determining the first sub-segment to which the final position belongs includes: and comparing the final position with the starting position and the end position of each sub-section to determine a first sub-section to which the final position belongs.
Optionally, the step of obtaining a final position of the slider dragged in the progress bar includes:
when the stay time of the slide block is greater than a preset threshold value, determining the stay position of the slide block as a final position;
the step of receiving a user jump instruction and jumping the document to a page corresponding to a page number in the jump page number input box comprises the following steps:
when user operation for releasing the sliding block is detected, determining that a user jump instruction is received, and jumping the document to a page corresponding to a page number in the jump page number input box; or the like, or, alternatively,
after receiving the page number input by the user in the skip page number input box, determining that a user skip instruction is received when detecting that a confirmation key on a displayed keyboard is pressed, and skipping the document to the page corresponding to the page number in the skip page number input box.
In order to achieve the above object, an embodiment of the present invention further discloses a document page jumping device, applied to an electronic document, the device including:
the first display module is used for displaying a progress bar and a skip page number input box in a current document page;
the obtaining module is used for obtaining the dragged final position of the sliding block in the progress bar when the sliding block on the progress bar is detected to be dragged;
the second display module is used for displaying the page number corresponding to the final position in the skip page number input box according to the corresponding relation between the preset progress bar position and the document page number;
the moving module is used for moving the sliding block to a position corresponding to the page number according to the corresponding relation between the preset progress bar position and the document page number when receiving the page number input by the user in the skip page number input box;
and the skipping module is used for skipping the document to the page corresponding to the page number in the skipping page number input box when a user skipping instruction is received.
Optionally, the first display module is specifically configured to:
and continuously arranging the progress bar and the skip page number input box and displaying the progress bar and the skip page number input box in a preset area of the current document page.
Optionally, the apparatus further comprises:
the corresponding relation presetting module is used for averagely dividing the progress bar into subsections equal to the total number of the page numbers in advance according to the total number of the page numbers, and each subsection corresponds to one page number;
the second display module includes:
a determining submodule, configured to determine a first sub-segment to which the final position belongs;
and the display sub-module is used for displaying the page number corresponding to the first sub-segment in the skip page number input box.
Optionally, the correspondence relationship presetting module includes:
the storage submodule is used for averagely dividing the length of the progress bar into subsections equal to the total number of the page numbers in advance according to the total number of the page numbers, and correspondingly storing the initial position and the end position of each subsection with one page number according to the sequence of the page numbers from small to large;
the determining submodule is specifically configured to:
and comparing the final position with the starting position and the end position of each sub-section to determine a first sub-section to which the final position belongs.
Optionally, the obtaining module includes:
the first determining submodule is used for determining the position where the sliding block stays as a final position when the stay time of the sliding block is greater than a preset threshold value;
the skip module includes:
the first skip submodule is used for determining that a user skip instruction is received when user operation for releasing the slider is detected, and skipping the document to a page corresponding to a page number in the skip page number input box; and the combination of (a) and (b),
and the second skip submodule is used for determining that a user skip instruction is received and skipping the document to a page corresponding to the page number in the skip page number input box when detecting that a confirmation key on the displayed keyboard is pressed after receiving the page number input by the user in the skip page number input box.
The technical scheme shows that the document page skipping method and the document page skipping device provided by the embodiment of the invention are applied to electronic documents, and a progress bar and a skipping page number input box are displayed in a current document page; if the sliding block on the progress bar is dragged, obtaining the dragged final position of the sliding block in the progress bar; displaying the page number corresponding to the final position in the skip page number input box according to the corresponding relation between the preset progress bar position and the document page number; if the page number input by the user in the skip page number input box is received, moving the sliding block to the position corresponding to the page number according to the corresponding relation between the preset progress bar position and the document page number; and receiving a user jump instruction, and jumping the document to a page corresponding to the page number in the jump page number input box.
By applying the embodiment of the invention, the user can position the page expected to jump without adjusting the position of the sliding block for many times, thereby simplifying the user operation and improving the user experience.
Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
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 only a part of the embodiments of the present invention, and not all of the embodiments. 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 discloses a document page skipping method and a document page skipping device, which are applied to electronic documents and are respectively explained in detail below.
Referring to fig. 2, fig. 2 is a schematic flowchart of a method for skipping a document page according to an embodiment of the present invention, including the following steps:
s201, displaying a progress bar and a skip page number input box in the current document page.
Specifically, the progress bar and the skip page number input box are continuously arranged and displayed in a preset area of the current document page. In practical applications, the document page may be an electronic document page such as a TXT document page, a Word document page, a WPS document page, and the like. The progress bar and the skip page number input box can be directly connected or connected through a connecting line.
Illustratively, the current document page is a WPS document page, and the progress bar is directly connected with the skip page input box and displayed above the WPS document page, or the progress bar is directly connected with the skip page input box and displayed below the WPS document page. As shown in fig. 3, the progress bar and the skip page input box are arranged in series, with the progress bar on the left and the skip page input box on the right.
S202, if the fact that the sliding block on the progress bar is dragged is detected, the final dragged position of the sliding block in the progress bar is obtained.
Specifically, the step of obtaining the final position of the slider dragged in the progress bar includes: and when the stay time of the slide block is greater than a preset threshold value, determining the stay position of the slide block as a final position.
For example, the preset threshold is 2s, when the slider on the progress bar is dragged, and the time for the slider to stay at a certain position is greater than 2s, the position may be determined as the final position where the slider is dragged in the progress bar.
S203, displaying the page number corresponding to the final position in the skip page number input box according to the corresponding relation between the preset progress bar position and the document page number.
Specifically, the preset corresponding relationship between the position and the page number includes: and dividing the progress bar into subsections equal to the total number of the pages in advance according to the total number of the pages, wherein each subsection corresponds to one page.
In practical application, the step of dividing the progress bar into subsections equal to the total number of the page numbers in advance according to the total number of the page numbers, wherein each subsection corresponds to one page number, comprises the following steps: and averagely dividing the length of the progress bar into subsections equal to the total number of the pages in advance according to the total number of the pages, and correspondingly storing the starting position and the end position of each subsection with one page according to the sequence of the pages from small to large.
Further, the step of displaying the page number corresponding to the final position in the skip page number input box according to the corresponding relation between the preset progress bar position and the document page number comprises the following steps: determining a first subsegment to which the final position belongs; and displaying the page number corresponding to the first subsection in a jump page number input box.
In practical applications, the step of determining the first sub-segment to which the final position belongs includes: and comparing the final position with the starting position and the end position of each sub-section to determine the first sub-section to which the final position belongs.
Assuming that the total number of the document pages is 100, the progress bar is averagely divided into 100 sub-segments, the starting position and the end position of the 1 st sub-segment of the progress bar are stored corresponding to page number 1, the starting position and the end position of the 2 nd sub-segment of the progress bar are stored corresponding to page number 2 according to the sequence of page numbers from small to large, … …, and so on, the starting position and the end position of the 100 th sub-segment of the progress bar are stored corresponding to page number 100. For example: the starting position and the end position of the 21 st subsection of the progress bar are stored corresponding to the page number 21, and the positions between the starting position and the end position of the 21 st subsection belong to the page number 21. And obtaining the final position according to the step S202, and if it is determined that the final position belongs to the 5 th sub-segment, displaying 5 in the skipped page number input box, so that the user can know the page number corresponding to the position of the slider according to the page number in the skipped page number input box.
S204, if the page number input by the user in the skip page number input box is received, moving the sliding block to the position corresponding to the page number according to the corresponding relation between the preset progress bar position and the document page number.
It should be noted that the page number input by the user in the skip page number input box may be any number of page numbers in the valid range, and the valid range is determined according to the total number of page numbers of the document.
Assuming that the total number of document pages is 100, the effective range of page numbers is 1-100, and the page number input by the user in the skip page number input box can be any number between 1-100, for example: if the page number input by the user in the skip page number input box is 21, the slider will move to any position between the starting position and the ending position of the 21 st sub-segment according to the corresponding relationship between the position of the progress bar preset in the step S203 and the page number of the document.
S205, receiving a user jump instruction, and jumping the document to a page corresponding to a page number in the jump page number input box.
Specifically, the step of receiving a user jump instruction and jumping the document to a page corresponding to a page number in a jump page number input box includes: when user operation for releasing the sliding block is detected, a user jump instruction is determined to be received, the document is jumped to a page corresponding to a page number in the jump page number input box, or after the page number input by the user in the jump page number input box is received, when a confirmation key on a displayed keyboard is detected to be pressed, the user jump instruction is determined to be received, and the document is jumped to the page corresponding to the page number in the jump page number input box.
Exemplarily, the mobile terminal is a touch screen mobile phone, the document is a WPS document, and if it is detected that the slider is dragged and the page number corresponding to the final position is 5, the page number displayed in the input box is 5; when the user releases the slider is detected, determining that a user skip instruction is received, and skipping the WPS document to a page corresponding to the page number 5; or when detecting that a confirmation key in the mobile phone input method is pressed, determining that a user skip instruction is received, and skipping the WPS document to a page corresponding to the page number 5.
Therefore, by applying the embodiment of the invention, the user can position the page expected to jump without adjusting the position of the sliding block for many times, the user operation is simplified, and the user experience is improved.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a document page jumping device.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a document page jumping apparatus according to an embodiment of the present invention, which corresponds to the flowchart shown in fig. 2, and includes:
a first display module 401, configured to display a progress bar and a skip page number input box in a current document page;
an obtaining module 402, configured to, when it is detected that the slider on the progress bar is dragged, obtain a final position where the slider is dragged in the progress bar;
a second display module 403, configured to display a page number corresponding to the final position in the skip page number input box according to a corresponding relationship between a preset progress bar position and a document page number;
a moving module 404, configured to, when a page number input by a user in the skip page number input box is received, move the slider to a position corresponding to the page number according to a corresponding relationship between a preset progress bar position and a document page number;
and the skipping module 405 is configured to skip the document to a page corresponding to a page number in the skipped page number input box when a user skipping instruction is received.
The first display module 401 is specifically configured to:
and continuously arranging the progress bar and the skip page number input box and displaying the progress bar and the skip page number input box in a preset area of the current document page.
In practical applications, the obtaining module 402 includes:
and the first determining submodule is used for determining the position where the slide block stays as the final position when the stay time of the slide block is greater than a preset threshold value.
A second display module 403 comprising: a determination submodule and a display submodule (not shown in fig. 4).
The determining submodule is used for determining a first subsegment to which the final position belongs;
and the display sub-module is used for displaying the page number corresponding to the first sub-segment in the skip page number input box.
Wherein the determining submodule is specifically configured to:
and comparing the final position with the starting position and the end position of each sub-section to determine the first sub-section to which the final position belongs.
In practical applications, the apparatus may further include: a correspondence presetting module (not shown in fig. 4).
The corresponding relation presetting module is used for averagely dividing the progress bar into subsections equal to the total number of the page numbers in advance according to the total number of the page numbers, and each subsection corresponds to one page number;
specifically, the module is preset to the corresponding relation, including:
and the storage submodule is used for averagely dividing the length of the progress bar into subsections equal to the total number of the page numbers in advance according to the total number of the page numbers, and correspondingly storing the starting position and the end position of each subsection with one page number according to the sequence of the page numbers from small to large.
Wherein, the skip module 405 includes: a first skip sub-module and a second skip sub-module (not shown in fig. 4).
The first skip submodule is used for determining that a user skip instruction is received when user operation for releasing the slider is detected, and skipping the document to a page corresponding to a page number in a skip page number input box;
and the second skip submodule is used for determining that a user skip instruction is received and skipping the document to a page corresponding to the page number in the skip page number input box when detecting that a confirmation key on the displayed keyboard is pressed after receiving the page number input by the user in the skip page number input box.
Therefore, by applying the embodiment shown in fig. 4 of the invention, the user can position the page expected to jump without adjusting the position of the slider for many times, thereby simplifying the user operation and improving the user experience.
It is noted that, herein, 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.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Those skilled in the art will appreciate that all or part of the steps in the above method embodiments may be implemented by a program to instruct relevant hardware to perform the steps, and the program may be stored in a computer-readable storage medium, which is referred to herein as a storage medium, such as: ROM/RAM, magnetic disk, optical disk, etc.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.