CN112579927A - Method and device for displaying navigation bar - Google Patents

Method and device for displaying navigation bar Download PDF

Info

Publication number
CN112579927A
CN112579927A CN201910945577.2A CN201910945577A CN112579927A CN 112579927 A CN112579927 A CN 112579927A CN 201910945577 A CN201910945577 A CN 201910945577A CN 112579927 A CN112579927 A CN 112579927A
Authority
CN
China
Prior art keywords
menu
navigation bar
size
displayed
display area
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
CN201910945577.2A
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 Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201910945577.2A priority Critical patent/CN112579927A/en
Publication of CN112579927A publication Critical patent/CN112579927A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/954Navigation, e.g. using categorised browsing

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method and a device for displaying a navigation bar. Wherein, the method comprises the following steps: determining a target size of the navigation bar when the display size of the navigation bar displayed in the display area changes; judging whether the target size is larger than the size of the display area; under the condition that the judgment result is negative, determining a first menu needing to be normally displayed and a second menu needing to be slightly displayed in the navigation bar according to prestored information, wherein the prestored information comprises size information of menu items in the navigation bar; and combining the first menu and the second menu, and displaying the navigation bar to enable the displayed navigation bar to be matched with the target size. The invention solves the technical problem that the size of each menu item needs to be determined again through a large amount of calculation when the size of the display area is changed in the prior art, so that the current page is stuck.

Description

Method and device for displaying navigation bar
Technical Field
The invention relates to the field of information display, in particular to a method and a device for displaying a navigation bar.
Background
The navigation bar in the prior art is usually fixed in width and cannot be adjusted adaptively according to the size of a display area. Fig. 1 shows a navigation bar in the prior art, and fig. 2 shows a display state of the navigation bar in fig. 1 when a width of a display area is reduced. It can be seen that the navigation bar does not support width adaptation, resulting in an unattractive display area. In order to overcome this problem, fig. 3 shows another navigation bar in the prior art, as shown in fig. 3, the navigation bar takes menu items as component units, each component needs to set a respective title and content, and if a current menu item has sub-menu items, sub-menu item components need to be manually added to the current menu item components to form the navigation bar. When the total width of the current navigation bar exceeds the width of the display area, the excess forms a single menu item in the form of the ellipsis "…" and the excess is displayed in the form of sub-menu items. However, this method requires a developer to perform a large number of repeated and cumbersome operations each time the component is set, and requires recalculation of the width of each menu item when the width of the display area is changed, and also, considering the width of the display area, there are unnecessary calculations, and a jam may be caused when the data amount is too large.
Aiming at the technical problem that the size of each menu item needs to be re-determined by a navigation bar through a large amount of calculation when the size of a display area is changed in the related art, so that the current page is stuck, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for displaying a navigation bar, which are used for solving the technical problem that the size of each menu item needs to be determined again through a large amount of calculation when the size of a display area is changed in the related art, so that the current page is stuck.
According to an aspect of an embodiment of the present invention, there is provided a method of displaying a navigation bar, including: determining a target size of the navigation bar when the display size of the navigation bar displayed in the display area changes; judging whether the target size is larger than the size of the display area; under the condition that the judgment result is negative, determining a first menu needing to be normally displayed and a second menu needing to be slightly displayed in the navigation bar according to prestored information, wherein the prestored information comprises size information of menu items in the navigation bar; and combining the first menu and the second menu, and displaying the navigation bar to enable the displayed navigation bar to be matched with the target size.
Optionally, the pre-stored information comprises: and integral size information corresponding to a plurality of combination modes of menu items in the navigation bar, wherein each combination consists of partial menu items.
Optionally, the pre-stored information is obtained by: step 1, taking the last menu item in the navigation bar as a target menu item; step 2, storing the integral size of the combination formed by the first menu item in the navigation bar to all menu items of the target menu item as integral size information corresponding to the current combination mode in the pre-stored information; and 3, repeatedly executing the step 2 until the current combination mode only comprises the first menu item and the second menu item in the navigation bar.
Optionally, determining a first menu required to be normally displayed and a second menu required to be briefly displayed in the navigation bar according to pre-stored information includes: based on the pre-stored information, preferentially comparing the overall size corresponding to the combination mode containing the most menu items with the target size until the overall size corresponding to the currently compared combination mode is smaller than the target size; and determining menu items contained in the current combination mode as a first menu, and determining menu items not contained in the current combination mode in the navigation bar as a second menu.
Optionally, the pre-stored information is obtained and saved when the navigation bar is loaded for the first time.
Optionally, combining the first menu and the second menu to display a navigation bar, including: setting a first menu in a display area and setting a second menu in a thumbnail area; and combining the display area and the thumbnail area for displaying, wherein the second menu is displayed in a floating manner within the preset range of the thumbnail area.
Optionally, after combining the first menu and the second menu and displaying the navigation bar to adapt the displayed navigation bar to the target size, the method further includes: receiving a configuration instruction of a navigation bar; configuring the first menu according to a configuration instruction, wherein the configuration instruction is used for configuring at least one of the following attributes: length, width, color, style, spacing, background, font, icon.
According to another aspect of the embodiments of the present invention, there is also provided an apparatus for displaying a navigation bar, including: the first determination module is used for determining the target size of the navigation bar under the condition that the display size of the navigation bar displayed in the display area is changed; the judging module is used for judging whether the target size is larger than the size of the display area; the second determining module is used for determining a first menu needing to be normally displayed and a second menu needing to be slightly displayed in the navigation bar according to pre-stored information under the condition that the judgment result is negative, wherein the pre-stored information comprises size information of menu items in the navigation bar; and the combination module is used for combining the first menu and the second menu and displaying the navigation bar so that the displayed navigation bar is matched with the target size.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium, where the storage medium includes a stored program, and when the program runs, the apparatus on which the storage medium is located is controlled to execute any one of the above methods for displaying a navigation bar.
According to another aspect of the embodiments of the present invention, there is also provided an apparatus, including at least one processor, and at least one memory connected to the processor, a bus; the processor and the memory complete mutual communication through a bus; the processor is configured to call program instructions in the memory to perform any one of the above-described methods for displaying a navigation bar.
In the embodiment of the invention, under the condition that the display size of the navigation bar displayed in the display area is changed, the target size of the navigation bar is determined; judging whether the target size is larger than the size of the display area; under the condition that the judgment result is negative, determining a first menu needing to be normally displayed and a second menu needing to be slightly displayed in the navigation bar according to prestored information, wherein the prestored information comprises size information of menu items in the navigation bar; and combining the first menu and the second menu, and displaying the navigation bar to enable the displayed navigation bar to be matched with the target size. Compared with the prior art, the method and the device have the advantages that through pre-storing information, such as the size information of the menu items in the navigation bar, the size information can be directly called to be compared with the target size under the condition that the size of the display area is changed, so that the navigation bar matched with the target size is obtained, the technical problem that the size of each menu item needs to be re-determined through a large amount of calculation when the size of the display area is changed in the related technology, so that the current page is blocked is solved, and the purpose of reducing the operation amount is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
FIG. 1 is a schematic view of a navigation bar according to the prior art;
FIG. 2 is a schematic view of the navigation bar shown in FIG. 1 as the width of the display area changes;
FIG. 3 is a schematic view of another navigation bar according to the prior art;
FIG. 4 is a flow diagram of an alternative method of displaying a navigation bar in accordance with embodiments of the present invention;
FIG. 5 is a schematic diagram illustrating an alternative variation of the navigation bar for reducing the size of the display area from right to left according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an alternative apparatus for displaying a navigation bar according to an embodiment of the present invention; and
fig. 7 is a schematic diagram of an alternative apparatus configuration according to an embodiment of the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all 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 application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of description, some terms or expressions referred to in the embodiments of the present application are explained below:
self-adaptation: the design of the webpage can automatically identify the width of the screen and make corresponding adjustment. The method achieves one-time design and universal application, enables the same webpage to automatically adapt to screens with different sizes, and automatically adjusts the layout according to the width of the screen.
In accordance with an embodiment of the present invention, there is provided an embodiment of a method of displaying a navigation bar, it being noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
Fig. 4 is a flowchart of a method of displaying a navigation bar according to an embodiment of the present invention, as shown in fig. 4, the method including the steps of:
in step S402, when the display size of the navigation bar displayed in the display area changes, the target size of the navigation bar is determined.
In an alternative, the display area may be a display interface of the device, or may be a sub-area of the display interface, and the device may provide a visualization platform; the navigation bar can be a menu item set positioned on the left side, the right side, the upper side or the lower side of the display area; the target size may be a size at which the navigation bar stops changing in size.
For example, the display interface includes a plurality of sub-regions, wherein one sub-region includes a navigation bar, which is a display region of the present application. In the case where other areas need to be displayed simultaneously in the display interface, the width of the display area needs to be reduced to leave a display area for the other areas. Therefore, the user drags a side of the display area perpendicular to the direction of the navigation bar by means of mouse sliding to reduce the size of the display area. If the sliding stops, the device receives an adjustment instruction of the display area.
For another example, when the same navigation bar is opened in another display with different size, the device may receive an adjustment instruction of the display area.
It should be noted that the adjustment instruction may be obtained based on the following steps:
and step 1, enlarging or reducing the current area to a target size through sliding operation.
In an alternative, the sliding operation may be performed by sliding the frame of the display area.
In step S4012, an adjustment instruction is generated based on the slide operation.
For example, the user positions the cursor of the mouse at the boundary of the display area, and clicks and slides the boundary left and right or up and down to enlarge or reduce the display area to a target size. The device generates an adjustment instruction based on the sliding operation of the user, so that the navigation bar is loaded, and the navigation bar is rearranged.
In step S404, it is determined whether the target size is larger than the size of the display area.
If the display size of the navigation bar is larger, which indicates that the size of the display area is larger, the target size is larger than the size of the display area; if the display size of the navigation bar becomes smaller, indicating that the size of the display area becomes smaller, then the target size is smaller than the size of the display area.
Step S406, under the condition that the judgment result is negative, determining a first menu needing to be normally displayed and a second menu needing to be briefly displayed in the navigation bar according to prestored information, wherein the prestored information comprises size information of menu items in the navigation bar.
In an alternative, the first menu and the second menu may each comprise one or more menu items, with the difference that one or more sub-menu items of the second menu are displayed in a thumbnail, e.g. marked collectively with a symbol; the first menu and the second menu may be components.
The pre-stored information may include overall size information corresponding to a plurality of combination modes of menu items in the navigation bar. Taking the leftmost menu item as the first menu item as an example, in the case that the width of the display area is reduced from right to left, the pre-stored information may include size information of the first menu item of the navigation bar, and size information of each of the first menu item to other menu items except the first menu item.
And step S408, combining the first menu and the second menu, and displaying the navigation bar to enable the displayed navigation bar to be matched with the target size.
Since the size information of the menu items in the navigation bar is prestored in the device, under the condition that the display size of the navigation bar displayed in the display area changes, the device only needs to directly call the size information and compare the size information with the target size, so that the menu items displayed on the target page to which the target size belongs and the menu items to be hidden can be determined and displayed in the form of the first menu and the second menu.
In an alternative embodiment, the display interface containing the navigation bar needs to be displayed on another small-sized display. Then at the time of initial loading of the display interface, the device calculates the size information of the menu items and stores it, for example, the size information of the first menu item, the size information of each of the first to other menu items except the first menu item. When the module is opened later, the size information is only required to be directly called and compared with the target size from back to front, when certain size information is found to be smaller than the target size, the number of displayed menu items can be determined, and the menu items beyond the display boundary can be folded, so that repeated operation required when the module is used is reduced, and a large amount of calculation is avoided.
In the above embodiment, when the display size of the navigation bar displayed in the display area changes, the target size of the navigation bar is determined; judging whether the target size is larger than the size of the display area; under the condition that the judgment result is negative, determining a first menu needing to be normally displayed and a second menu needing to be slightly displayed in the navigation bar according to prestored information, wherein the prestored information comprises size information of menu items in the navigation bar; and combining the first menu and the second menu, and displaying the navigation bar to enable the displayed navigation bar to be matched with the target size. Compared with the prior art, the method and the device have the advantages that through pre-storing information, such as the size information of the menu items in the navigation bar, the size information can be directly called to be compared with the target size under the condition that the size of the display area is changed, so that the navigation bar matched with the target size is obtained, the technical problem that the size of each menu item needs to be re-determined through a large amount of calculation when the size of the display area is changed in the related technology, so that the current page is blocked is solved, and the purpose of reducing the operation amount is achieved.
Optionally, the pre-stored information comprises: and integral size information corresponding to a plurality of combination modes of menu items in the navigation bar, wherein each combination consists of partial menu items.
Still taking the leftmost menu item as the first menu item as an example, in the case that the width of the current area is reduced from left to right, the pre-stored information may include size information of the last menu item of the navigation bar, and size information of each of the last menu item to other menu items except the last menu item.
Take the top menu item as the first menu item as an example: in a case where the width of the current area is reduced from bottom to top, the pre-stored information may include size information of a first menu item of the navigation bar, and size information of each of the first menu item to other menu items except the first menu item. In the case of reducing the width of the current area from top to bottom, the pre-stored information may include size information of the last menu item of the navigation bar, and size information of each of the last menu item to other menu items except the last menu item.
In an alternative embodiment, the pre-stored information is obtained by: and step 1, taking the last menu item in the navigation bar as a target menu item. And 2, storing the integral size of the combination formed by the first menu item in the navigation bar to all menu items of the target menu item as integral size information corresponding to the current combination mode in the pre-stored information. And 3, repeatedly executing the step 2 until the current combination mode only comprises the first menu item and the second menu item in the navigation bar.
It should be noted that the overall size may be size information of dimensions such as width and length of all menu items in the current combination mode.
Optionally, in step S406, the first menu that needs to be normally displayed and the second menu that needs to be abbreviated in the navigation bar are determined according to the pre-stored information, and the method may specifically include the following steps:
step S4061, based on the pre-stored information, preferentially comparing the overall size corresponding to the combination mode containing the most menu items with the target size until the overall size corresponding to the currently compared combination mode is smaller than the target size.
Step S4062, determining the menu item contained in the current combination mode as a first menu, and determining the menu item not contained in the current combination mode in the navigation bar as a second menu.
In an optional embodiment, if in the process of the first comparison, it is determined that the size information from the last menu item to the first menu item is smaller than the target size, which indicates that the size of the current area is increasing, then all the menu items in the navigation bar may be directly displayed without any change to the layout of the current navigation bar. If in the process of the first comparison, it is determined that the size information from the last menu item to the first menu item is larger than the target size, which indicates that the size of the current area is reduced, the size information from the last menu item to the first menu item needs to be continuously compared with the target size until the size information from the target menu item to the first menu item is smaller than the target size, which indicates that the first menu item to the target menu item can be displayed on the target page to which the target size belongs. By continuously comparing the overall size of the menu items contained in the current combination mode with the size of the target size, the menu items capable of being displayed in the display area can be quickly determined, and further the menu items in the second menu needing to be displayed in a thumbnail mode are determined.
Optionally, the pre-stored information is obtained and saved when the navigation bar is loaded for the first time.
It should be noted that the pre-stored information is stored in the device at the first load, thereby avoiding the need for a redundant operation of calculating the size each time it is loaded.
Optionally, the step S408 combines the first menu and the second menu to display the navigation bar, and may specifically include the following steps:
step S4081 sets the first menu in the display area and the second menu in the thumbnail area.
In an alternative, the location of the thumbnail region may be determined by a movement boundary of the display area, typically located on a side near the movement boundary. For example, in the process of moving the right boundary of the display area to the left by sliding the mouse, the thumbnail area can be always displayed close to the moving boundary; the left side of the thumbnail area is a display area, and a first menu capable of being displayed is displayed on the display area; the thumbnail regions may be identified by special indicia, such as the ellipses "…", right triangle ". DELTA", inverted triangle ". DELTA", right triangle
Figure BDA0002224035250000081
Left triangle
Figure BDA0002224035250000082
And the like.
The position of the second menu is determined, which is equivalent to determining menu items that can be displayed and menu items that cannot be displayed on the target area. For the menu items which cannot be displayed, the menu items which are behind the first menu can be hidden and marked by special marks, so that the width self-adaption of the navigation bar is realized.
Step S4082, the display area and the thumbnail area are combined and then displayed, wherein the second menu is displayed in a suspension mode within the preset range of the thumbnail area.
In an alternative, the menu items of the second menu may be displayed in a floating manner within a preset range of the thumbnail area in a list or pull-down menu manner.
The menu items of the second menu can be displayed in a suspension manner within the preset range of the thumbnail area by clicking the thumbnail area, parking the cursor in the thumbnail area and touching the thumbnail area in any one or more manners, so that the user can still find the needed menu items under the condition that the size of the display area is reduced.
Optionally, after the step S408 is executed to combine the first menu and the second menu, and display the navigation bar, so that the displayed navigation bar is adapted to the target size, the method may further include the following steps:
step S4091, a configuration instruction of the navigation bar is received.
Step S4092, configuring the first menu according to a configuration instruction, wherein the configuration instruction is used for configuring at least one of the following attributes: length, width, color, style, spacing, background, font, icon.
In the above scheme, by configuring the length, width or interval of the first menu, more or fewer menu items can be displayed in the display area; through configuring the color, style, background, font or icon of the first menu, the personalized setting of the navigation bar can be realized, and the use habit of the user is met.
FIG. 5 illustrates a schematic diagram of a navigation bar change that reduces the size of the display area from right to left. As shown in fig. 5, the display interface includes a display area and other areas. The display area includes 5 menu items arranged laterally. The cursor is positioned at the right border of the display area and the sliding mouse is moved to the left, finally resting on the 3 rd menu item. When the device compares for the first time, it is determined that the size information from the 5 th menu item to the 1 st menu item is larger than the target size, which indicates that the size of the current area is becoming smaller, and then it is necessary to continue to compare the size information from the 4 th menu item to the 1 st menu item with the target size, and the size information from the 3 rd menu item to the 1 st menu item with the target size. Until the comparison determines that the size information of the 2 nd to 1 st menu items is smaller than the target size, which indicates that the 1 st to 2 nd menu items can be displayed on the target page to which the target size belongs, and the 3 rd to 5 th menu items are represented by an ellipsis mark "…". Because the calculation process is simple, the display interface can synchronously respond to the sliding operation. If the mouse hovers over the ellipsis "…" representing the thumbnail region, the 3 rd to 5 th menu items are floating near the thumbnail region in a drop-down fashion.
In the above embodiments of the present application, when the display size of the navigation bar displayed in the display area changes, the target size of the navigation bar is determined; judging whether the target size is larger than the size of the display area; under the condition that the judgment result is negative, determining a first menu needing to be normally displayed and a second menu needing to be slightly displayed in the navigation bar according to prestored information, wherein the prestored information comprises size information of menu items in the navigation bar; and combining the first menu and the second menu, and displaying the navigation bar to enable the displayed navigation bar to be matched with the target size. Compared with the prior art, the method and the device have the advantages that through pre-storing information, such as the size information of the menu items in the navigation bar, the size information can be directly called to be compared with the target size under the condition that the size of the display area is changed, so that the navigation bar matched with the target size is obtained, the technical problem that the size of each menu item needs to be re-determined through a large amount of calculation when the size of the display area is changed in the related technology, so that the current page is blocked is solved, and the purpose of reducing the operation amount is achieved. It is easy to notice that the pre-stored information is obtained and stored when the navigation bar is loaded for the first time and comprises the whole size information corresponding to various combination modes of menu items in the navigation bar, so that the size information is greatly convenient to call; comparing the overall size corresponding to the combination mode containing the most menu items with the target size preferentially until the overall size corresponding to the currently compared combination mode is smaller than the target size, so that the menu items contained in the first menu and the second menu can be quickly determined; the second menu is displayed in a floating mode when needed, so that a user can find needed menu items in a display front area with any size; through the configuration of the first menu in the navigation bar, the personalized display of the navigation bar is realized, so that the navigation bar is more in line with the use habit of a user, and the man-machine interaction is improved
According to an embodiment of the present invention, there is further provided an apparatus for displaying a navigation bar, and fig. 6 is a schematic diagram of an apparatus for displaying a navigation bar according to an embodiment of the present application. As shown in fig. 6, the apparatus 600 includes a first determining module 602, a determining module 604, a second determining module 606, and a combining module 608.
The first determining module 602 is configured to determine a target size of the navigation bar when a display size of the navigation bar displayed in the display area changes; a determining module 604, configured to determine whether the target size is larger than the size of the display area; a second determining module 606, configured to determine, according to pre-stored information, a first menu that needs to be normally displayed and a second menu that needs to be slightly displayed in the navigation bar if the determination result is negative, where the pre-stored information includes size information of menu items in the navigation bar; and the combination module 608 is configured to combine the first menu and the second menu, and display the navigation bar, so that the displayed navigation bar is adapted to the target size.
It should be noted that the apparatus for displaying a navigation bar includes a processor and a memory, the first receiving module 602 and the loading module 604 are both stored in the memory as program module units, and the processor executes the program module units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the Wien diagram and the keywords are displayed simultaneously by adjusting the kernel parameters, so that the use effect is improved.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
Optionally, the pre-stored information comprises: and integral size information corresponding to a plurality of combination modes of menu items in the navigation bar, wherein each combination consists of partial menu items.
Optionally, the pre-stored information is obtained by a pre-storing module, and the pre-storing module includes: the target module is used for taking the last menu item in the navigation bar as a target menu item; the storage module is used for storing the integral size of a combination formed by a first menu item in the navigation bar and all menu items of a target menu item as integral size information corresponding to the current combination mode in the pre-stored information; and the repeating module is used for repeatedly executing the method of the storage module until the current combination mode only contains the first menu item and the second menu item in the navigation bar.
Optionally, the second determining module includes: the comparison module is used for preferentially comparing the overall size corresponding to the combination mode containing the most menu items with the target size on the basis of the pre-stored information until the overall size corresponding to the currently compared combination mode is smaller than the target size; and the second determining submodule is used for determining the menu items contained in the current combination mode as the first menu and determining the menu items not contained in the current combination mode in the navigation bar as the second menu.
Optionally, the pre-stored information is obtained and saved when the navigation bar is loaded for the first time.
Optionally, the combination module comprises: the setting module is used for setting the first menu in the display area and setting the second menu in the thumbnail area; and the combining submodule is used for combining the display area and the abbreviated area and then displaying the combined display area and the abbreviated area, wherein the second menu is displayed in a suspension mode within the preset range of the abbreviated area.
Optionally, the apparatus further comprises: the receiving module is used for combining the first menu and the second menu, displaying the navigation bar and receiving a configuration instruction of the navigation bar after the displayed navigation bar is matched with the target size; the configuration module is used for configuring the first menu according to a configuration instruction, wherein the configuration instruction is used for configuring at least one of the following attributes: length, width, color, style, spacing, background, font, icon.
It should be noted that the first determining module 602, the judging module 604, the second determining module 606 and the combining module 608 correspond to steps S402 to S408 in the method embodiment, and these four modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the method embodiment.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program, where the apparatus on which the storage medium is located is controlled to execute any one of the methods of the method embodiments when the program runs.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to run a program, where the program executes any one of the methods of the method embodiments when running.
According to another aspect of the embodiments of the present invention, there is also provided an apparatus 700, as shown in fig. 7, the apparatus includes at least one processor 701, and at least one memory 702 connected to the processor 701, a bus 703; the processor 701 and the memory 702 complete mutual communication through a bus 703; processor 701 is configured to invoke program instructions in memory 702 to perform a method of displaying a navigation bar in accordance with any of the method embodiments.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
determining a target size of the navigation bar when the display size of the navigation bar displayed in the display area changes; judging whether the target size is larger than the size of the display area; under the condition that the judgment result is negative, determining a first menu needing to be normally displayed and a second menu needing to be slightly displayed in the navigation bar according to prestored information, wherein the prestored information comprises size information of menu items in the navigation bar; and combining the first menu and the second menu, and displaying the navigation bar to enable the displayed navigation bar to be matched with the target size.
Optionally, the pre-stored information comprises: and integral size information corresponding to a plurality of combination modes of menu items in the navigation bar, wherein each combination consists of partial menu items.
Optionally, the pre-stored information is obtained by: step 1, taking the last menu item in the navigation bar as a target menu item; step 2, storing the integral size of the combination formed by the first menu item in the navigation bar to all menu items of the target menu item as integral size information corresponding to the current combination mode in the pre-stored information; and 3, repeatedly executing the step 2 until the current combination mode only comprises the first menu item and the second menu item in the navigation bar.
Optionally, determining a first menu required to be normally displayed and a second menu required to be briefly displayed in the navigation bar according to pre-stored information includes: based on the pre-stored information, preferentially comparing the overall size corresponding to the combination mode containing the most menu items with the target size until the overall size corresponding to the currently compared combination mode is smaller than the target size; and determining menu items contained in the current combination mode as a first menu, and determining menu items not contained in the current combination mode in the navigation bar as a second menu.
Optionally, the pre-stored information is obtained and saved when the navigation bar is loaded for the first time.
Optionally, combining the first menu and the second menu to display a navigation bar, including: setting a first menu in a display area and setting a second menu in a thumbnail area; and combining the display area and the thumbnail area for displaying, wherein the second menu is displayed in a floating manner within the preset range of the thumbnail area.
Optionally, after combining the first menu and the second menu and displaying the navigation bar to adapt the displayed navigation bar to the target size, the method further includes: receiving a configuration instruction of a navigation bar; configuring the first menu according to a configuration instruction, wherein the configuration instruction is used for configuring at least one of the following attributes: length, width, color, style, spacing, background, font, icon.
The device in the application can be a server, a PC, a PAD, a mobile phone and the like.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
determining a target size of the navigation bar when the display size of the navigation bar displayed in the display area changes; judging whether the target size is larger than the size of the display area; under the condition that the judgment result is negative, determining a first menu needing to be normally displayed and a second menu needing to be slightly displayed in the navigation bar according to prestored information, wherein the prestored information comprises size information of menu items in the navigation bar; and combining the first menu and the second menu, and displaying the navigation bar to enable the displayed navigation bar to be matched with the target size.
Optionally, the pre-stored information comprises: and integral size information corresponding to a plurality of combination modes of menu items in the navigation bar, wherein each combination consists of partial menu items.
Optionally, the pre-stored information is obtained by: step 1, taking the last menu item in the navigation bar as a target menu item; step 2, storing the integral size of the combination formed by the first menu item in the navigation bar to all menu items of the target menu item as integral size information corresponding to the current combination mode in the pre-stored information; and 3, repeatedly executing the step 2 until the current combination mode only comprises the first menu item and the second menu item in the navigation bar.
Optionally, determining a first menu required to be normally displayed and a second menu required to be briefly displayed in the navigation bar according to pre-stored information includes: based on the pre-stored information, preferentially comparing the overall size corresponding to the combination mode containing the most menu items with the target size until the overall size corresponding to the currently compared combination mode is smaller than the target size; and determining menu items contained in the current combination mode as a first menu, and determining menu items not contained in the current combination mode in the navigation bar as a second menu.
Optionally, the pre-stored information is obtained and saved when the navigation bar is loaded for the first time.
Optionally, combining the first menu and the second menu to display a navigation bar, including: setting a first menu in a display area and setting a second menu in a thumbnail area; and combining the display area and the thumbnail area for displaying, wherein the second menu is displayed in a floating manner within the preset range of the thumbnail area.
Optionally, after combining the first menu and the second menu and displaying the navigation bar to adapt the displayed navigation bar to the target size, the method further includes: receiving a configuration instruction of a navigation bar; configuring the first menu according to a configuration instruction, wherein the configuration instruction is used for configuring at least one of the following attributes: length, width, color, style, spacing, background, font, icon.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined in this embodiment, the computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
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 identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method of displaying a navigation bar, comprising:
determining a target size of a navigation bar displayed in a display area under the condition that the display size of the navigation bar changes;
judging whether the target size is larger than the size of the display area;
under the condition that the judgment result is negative, determining a first menu needing to be normally displayed and a second menu needing to be slightly displayed in the navigation bar according to prestored information, wherein the prestored information comprises size information of menu items in the navigation bar;
and combining the first menu and the second menu, and displaying the navigation bar to enable the displayed navigation bar to be matched with the target size.
2. The method of claim 1, wherein the pre-stored information comprises: and integral size information corresponding to multiple combination modes of menu items in the navigation bar, wherein each combination consists of partial menu items.
3. The method of claim 2, wherein the pre-stored information is obtained by:
step 1, taking the last menu item in the navigation bar as a target menu item;
step 2, saving the integral size of the combination formed by the first menu item in the navigation bar to all menu items of the target menu item as integral size information corresponding to the current combination mode in the pre-stored information;
and 3, repeatedly executing the step 2 until the current combination mode only comprises the first menu item and the second menu item in the navigation bar.
4. The method according to claim 2 or 3, wherein determining the first menu in the navigation bar that needs to be normally displayed and the second menu in the navigation bar that needs to be briefly displayed according to pre-stored information comprises:
on the basis of the pre-stored information, preferentially comparing the overall size corresponding to the combination mode containing the most menu items with the target size until the overall size corresponding to the currently compared combination mode is smaller than the target size;
and determining menu items contained in the current combination mode as a first menu, and determining menu items which are not contained in the current combination mode in the navigation bar as a second menu.
5. The method according to any of claims 1-3, wherein the pre-stored information is obtained and saved when the navigation bar is first loaded.
6. The method of claim 1, wherein combining the first menu and the second menu to display the navigation bar comprises:
setting the first menu in a display area and setting the second menu in a thumbnail area;
and combining the display area and the thumbnail area and then displaying, wherein the second menu is displayed in a suspension manner within a preset range of the thumbnail area.
7. The method of claim 1, wherein after combining the first menu and the second menu, displaying the navigation bar, and adapting the displayed navigation bar to the target size, the method further comprises:
receiving a configuration instruction of the navigation bar;
configuring the first menu according to the configuration instruction, wherein the configuration instruction is used for configuring at least one of the following attributes: length, width, color, style, spacing, background, font, icon.
8. An apparatus for displaying a navigation bar, comprising:
the first determination module is used for determining the target size of the navigation bar under the condition that the display size of the navigation bar displayed in the display area is changed;
the judging module is used for judging whether the target size is larger than the size of the display area;
a second determining module, configured to determine, according to pre-stored information, a first menu that needs to be normally displayed and a second menu that needs to be slightly displayed in the navigation bar if the determination result is negative, where the pre-stored information includes size information of menu items in the navigation bar;
and the combination module is used for combining the first menu and the second menu and displaying the navigation bar so that the displayed navigation bar is matched with the target size.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein when the program runs, a device in which the storage medium is located is controlled to execute the method for displaying a navigation bar according to any one of claims 1 to 7.
10. An apparatus comprising at least one processor, and at least one memory connected to the processor, a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to invoke program instructions in the memory to perform a method of displaying a navigation bar according to any one of claims 1 to 7.
CN201910945577.2A 2019-09-30 2019-09-30 Method and device for displaying navigation bar Pending CN112579927A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910945577.2A CN112579927A (en) 2019-09-30 2019-09-30 Method and device for displaying navigation bar

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910945577.2A CN112579927A (en) 2019-09-30 2019-09-30 Method and device for displaying navigation bar

Publications (1)

Publication Number Publication Date
CN112579927A true CN112579927A (en) 2021-03-30

Family

ID=75116931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910945577.2A Pending CN112579927A (en) 2019-09-30 2019-09-30 Method and device for displaying navigation bar

Country Status (1)

Country Link
CN (1) CN112579927A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568540A (en) * 2021-07-29 2021-10-29 北京锐安科技有限公司 Method, device, equipment and medium for displaying function menu in Web application
CN114816174A (en) * 2022-04-26 2022-07-29 曙光网络科技有限公司 Navigation bar switching method and device, electronic equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004109557A1 (en) * 2003-06-03 2004-12-16 Forbes Holten Norris, Iii Flexible, dynamic menu-based web-page architecture
CN101067777A (en) * 2007-07-06 2007-11-07 华为技术有限公司 A terminal menu displaying method and terminal equipment
CN101150810A (en) * 2007-10-10 2008-03-26 叶志宝 A mobile phone device for dynamically ranking and displaying menu and its method
CN102402435A (en) * 2011-10-25 2012-04-04 汉王科技股份有限公司 Menu realization method, menu realization device and display device
CN102855124A (en) * 2011-06-27 2013-01-02 腾讯科技(深圳)有限公司 Method and device for adjusting navigation bar in self-adaptive manner on browser and browser
CN105335055A (en) * 2015-10-29 2016-02-17 努比亚技术有限公司 Self-response type realization method and system of menu as well as terminal equipment
CN106598408A (en) * 2016-11-25 2017-04-26 维沃移动通信有限公司 Method for switching navigation bar and mobile terminal
WO2017197800A1 (en) * 2016-05-16 2017-11-23 中兴通讯股份有限公司 Menu display method and apparatus
CN107621967A (en) * 2017-09-27 2018-01-23 深圳市道通科技股份有限公司 The implementation method and device of a kind of system user interface
CN108108417A (en) * 2017-12-14 2018-06-01 携程商旅信息服务(上海)有限公司 Exchange method, system, equipment and the storage medium of cross-platform self adaptive control

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004109557A1 (en) * 2003-06-03 2004-12-16 Forbes Holten Norris, Iii Flexible, dynamic menu-based web-page architecture
CN101067777A (en) * 2007-07-06 2007-11-07 华为技术有限公司 A terminal menu displaying method and terminal equipment
CN101150810A (en) * 2007-10-10 2008-03-26 叶志宝 A mobile phone device for dynamically ranking and displaying menu and its method
CN102855124A (en) * 2011-06-27 2013-01-02 腾讯科技(深圳)有限公司 Method and device for adjusting navigation bar in self-adaptive manner on browser and browser
CN102402435A (en) * 2011-10-25 2012-04-04 汉王科技股份有限公司 Menu realization method, menu realization device and display device
CN105335055A (en) * 2015-10-29 2016-02-17 努比亚技术有限公司 Self-response type realization method and system of menu as well as terminal equipment
WO2017197800A1 (en) * 2016-05-16 2017-11-23 中兴通讯股份有限公司 Menu display method and apparatus
CN106598408A (en) * 2016-11-25 2017-04-26 维沃移动通信有限公司 Method for switching navigation bar and mobile terminal
CN107621967A (en) * 2017-09-27 2018-01-23 深圳市道通科技股份有限公司 The implementation method and device of a kind of system user interface
CN108108417A (en) * 2017-12-14 2018-06-01 携程商旅信息服务(上海)有限公司 Exchange method, system, equipment and the storage medium of cross-platform self adaptive control

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王基生, 张俊俊, 刘志勤, 岳大鑫: "网络课程特效导航菜单的制作", 计算机应用, no. 11, 28 November 2001 (2001-11-28) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568540A (en) * 2021-07-29 2021-10-29 北京锐安科技有限公司 Method, device, equipment and medium for displaying function menu in Web application
CN113568540B (en) * 2021-07-29 2024-04-23 北京锐安科技有限公司 Function menu display method, device, equipment and medium in Web application
CN114816174A (en) * 2022-04-26 2022-07-29 曙光网络科技有限公司 Navigation bar switching method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US20210349615A1 (en) Resizing graphical user interfaces
US10366147B2 (en) Techniques for programmatic magnification of visible content elements of markup language documents
US8504915B2 (en) Optimizations for hybrid word processing and graphical content authoring
CN107977342B (en) Document comparison method and device
CN106201234A (en) The inspection method of content of pages and device
CN110308835B (en) Method and device for controlling view control and electronic equipment
KR20160086842A (en) Resizing technique for display content
CN112579927A (en) Method and device for displaying navigation bar
CN112099789A (en) Human-computer interaction design method, device, equipment and storage medium
WO2023165197A1 (en) Method and apparatus for adjusting interface layout, device and storage medium
CN109857964B (en) Thermodynamic diagram drawing method and device for page operation, storage medium and processor
CN111465917A (en) Bendable electronic equipment and interface adaptation method thereof
JP6199917B2 (en) Improved readability on mobile devices
CN109992580A (en) Processing method and processing device, storage medium, the computer equipment of table data
CN111143731B (en) Display method and device for webpage interface zooming and terminal equipment
US11243678B2 (en) Method of panning image
CN111273826A (en) Desktop icon management method, device, equipment and storage medium
CN109189537A (en) The dynamic display method of page info calculates equipment and computer storage medium
CN112578963A (en) Menu processing method and device, storage medium and electronic equipment
CN115080175B (en) Display method, display device, computing equipment and readable storage medium
CN111814087B (en) Dynamic layout method and device of Web window, electronic equipment and readable storage medium
US11640491B2 (en) Automatic font value distribution for variable fonts
CN112540715B (en) Pasting method of note content, terminal and computer storage medium
CN114327208B (en) Legend display method and device, storage medium and terminal
EP4027228B1 (en) Method controlling operation list, electronic device, and storage medium

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