[summary of the invention]
Based on this, be necessary to provide a kind of web page contents localization method that can improve web page contents locating speed.
A kind of web page contents localization method, comprises the following steps:
Obtain the clicking operation of the neutron navigation area, navigation area to webpage;
Obtain the anchor point that sub-navigation area corresponding to described clicking operation links;
Obtain the webpage position of described anchor point correspondence in the space of a whole page content of the content viewing area of webpage;
The space of a whole page content of the content viewing area of webpage is jumped to the webpage position of described correspondence;
The separate subregion that described navigation area and described content viewing area are webpage.
In an embodiment, before the step of clicking operation of obtaining the neutron navigation area, navigation area to webpage, described method also comprises therein:
In the source code of navigation area, obtain the anchor point that the sub-navigation area of navigation area links;
In the source code of content viewing area, obtain the source code block that described anchor point is corresponding;
Obtain described source code block and resolve the flag information of the space of a whole page content forming;
In the sub-navigation area of correspondence, show described flag information.
In an embodiment, the step of obtaining the source code block that described anchor point is corresponding is therein:
In the source code of content viewing area, search the next anchor point of described anchor point, obtaining described anchor point to the source code block between described next anchor point is the source code block that described anchor point is corresponding;
If found the source code end of content viewing area but do not found described next anchor point, obtaining described anchor point to the source code block between the source code end of content viewing area is the source code block that described anchor point is corresponding.
Therein in an embodiment, described flag information comprises the segment word in thumbnail or the space of a whole page content of space of a whole page content.
In an embodiment, described content viewing area comprises the scroll bar moving for controlling space of a whole page content therein;
After the space of a whole page content of the content viewing area of webpage is jumped to the step of webpage position of described correspondence, described method also comprises:
Move the position of scroll bar in scrolling bar according to described webpage position.
In addition, be also necessary to provide a kind of web page contents locating device that can improve web page contents locating speed.
A kind of web page contents locating device, comprising:
Operation acquisition module, for obtaining the clicking operation of the neutron navigation area, navigation area to webpage;
Clicking operation anchor point acquisition module, the anchor point linking for obtaining sub-navigation area corresponding to described clicking operation;
Webpage position acquisition module, for obtaining described anchor point in webpage position corresponding to the space of a whole page content of the content viewing area of webpage;
Redirect module, for jumping to the space of a whole page content of the content viewing area of webpage the webpage position of described correspondence;
The separate subregion that described navigation area and described content viewing area are webpage.
In an embodiment, described system also comprises therein:
Sub-navigation area anchor point acquisition module, the anchor point linking for obtain the sub-navigation area of navigation area at the source code of navigation area,
Source code block acquisition module obtains the source code block that described anchor point is corresponding in the source code of content viewing area;
Flag information acquisition module, resolves the flag information of the space of a whole page content forming for obtaining described source code block;
Display module, shows described flag information for the sub-navigation area in correspondence.
Therein in an embodiment, described source code block acquisition module is for searching the next anchor point of described anchor point at the source code of content viewing area, obtaining described anchor point to the source code block between described next anchor point is the source code block that described anchor point is corresponding, if found the source code end of content viewing area but do not found described next anchor point, obtaining described anchor point to the source code block between the source code end of content viewing area is the source code block that described anchor point is corresponding.
Therein in an embodiment, described flag information comprises the segment word in thumbnail or the space of a whole page content of space of a whole page content.
In an embodiment, described content viewing area comprises the scroll bar moving for controlling space of a whole page content therein;
Described system also comprises scroll bar mobile module, for moving the position of scroll bar at scrolling bar according to described webpage position.
Above-mentioned web page contents localization method and device, webpage comprises separate two subregion navigation areas and content viewing area, the space of a whole page content of content viewing area is navigated to corresponding webpage position by the sub-navigation area that can click in navigation area, thereby improved the locating speed of web page contents.
[embodiment]
As shown in Figure 1, in one embodiment, a kind of web page contents localization method, comprises the following steps:
Step S101, obtains the clicking operation of the neutron navigation area, navigation area to webpage.
In the present embodiment, webpage comprises navigation area and content viewing area.Navigation area and content viewing area be the separate subregion of two in corresponding webpage source code respectively.The web page contents showing in content viewing area is called space of a whole page content, and content viewing area comprises the scroll bar moving for controlling space of a whole page content.The space of a whole page content showing in content viewing area changes along with the movement of scroll bar.Navigation area comprises multiple sub-navigation areas.In sub-navigation area, show the flag information of corresponding space of a whole page content.In one embodiment, the position pattern of navigation area is " fixed " pattern, and this pattern can make the position of navigation area in webpage immobilize.
Step S102, obtains the anchor point that sub-navigation area corresponding to clicking operation links.
In one embodiment, can be in advance in the source code of content viewing area precalculated position anchor point is set.For example, to be called the anchor point that " nav_name1 ", ID are " nav_id1 " as follows: <a name=name can be set " nav_name1 " id=" nav_id1 " ></a>.The anchor point arranging can be divided into multiple source code block by the source code of content viewing area, some anchor points are the source code block that this anchor point is corresponding to the source code block between its next anchor point, and last anchor point to the source code block between the source code end of content viewing area is the source code block that this last anchor point is corresponding.
Further, can be each sub-navigation area the link of pointing to some anchor points is set.Concrete, the link of pointing to some anchor points can be set in the source code of each sub-navigation area.For example, can in the source code of a certain sub-navigation area, arrange one point to above-mentioned ID for " nav_id1 " and the link of anchor point: <ahref=" #nav_id1 " >, the anchor point that this sub-navigation area links be above-mentioned ID for " nav_id1 " and anchor point.
Step S102 can search title or the ID of the anchor point comprising in the source code of sub-navigation area corresponding to clicking operation.
Step S103, the webpage position that obtains linked anchor point correspondence in the space of a whole page content of the content viewing area of webpage.
Concrete, can in the source code of content viewing area, search title or the ID of above-mentioned anchor point, corresponding webpage position in the space of a whole page content of content viewing area, this position of the position acquisition in the source code of content viewing area according to the title of this anchor point or ID.
Step S104, jumps to the space of a whole page content of the content viewing area of webpage the webpage position of above-mentioned correspondence.
Concrete, the above-mentioned webpage position of space of a whole page content can be moved to the top of content viewing area.
In one embodiment, as mentioned above, content viewing area comprises the scroll bar moving for controlling space of a whole page content.After step S104, above-mentioned web page contents localization method also comprises step: the position of scroll bar in scrolling bar moved in the webpage position obtaining according to step S103.
For example, above-mentioned webpage position is positioned at the middle part of space of a whole page content, scroll bar can be moved to the middle part of scrolling bar.
As shown in Figure 2, in one embodiment, before step S101, above-mentioned web page contents localization method also comprises the step that generates and show the flag information of space of a whole page content, and its process comprises the following steps:
Step S201 obtains the anchor point that the sub-navigation area of navigation area links in the source code of navigation area.
In one embodiment, can in the source code of each sub-navigation area, search title or the ID of the anchor point comprising, this title or ID are title or the ID of the anchor point that corresponding sub-navigation area links.
Step S202 obtains source code block corresponding to anchor point that sub-navigation area links in the source code of content viewing area.
In one embodiment, can in the source code of content viewing area, search the next anchor point of the anchor point that sub-navigation area links, obtain source code block corresponding to anchor point that anchor point that sub-navigation area links links for this sub-navigation area to the source code block between its next anchor point.If found the source code end of content viewing area but do not found next anchor point, obtain source code block corresponding to anchor point that anchor point that sub-navigation area links links for this sub-navigation area to the source code block between the source code end of content viewing area.
Step S203, obtains corresponding source code block and resolves the flag information of the space of a whole page content forming.
In one embodiment, the flag information of space of a whole page content comprises the segment word in thumbnail or the space of a whole page content of space of a whole page content.Concrete, can use sectional drawing instrument to carry out sectional drawing to space of a whole page content, obtain the thumbnail of space of a whole page content.
Step S204 shows the flag information of space of a whole page content in the sub-navigation area of correspondence.
Fig. 3 is webpage typesetting schematic diagram in above-mentioned web page contents localization method in an embodiment.The content viewing area 301 of webpage is positioned at webpage left side, and the web page contents showing in content viewing area 301 is called space of a whole page content.Navigation area 302 is positioned at webpage right side, and navigation area 302 comprises multiple sub-navigation areas, shows the thumbnail of corresponding space of a whole page content in sub-navigation area.In the time that user clicks a certain sub-navigation area, the space of a whole page content of content viewing area jumps to position corresponding to this sub-navigation area.
As shown in Figure 4, in one embodiment, a kind of web page contents locating device, comprises operation acquisition module 401, clicking operation anchor point acquisition module 402, webpage position acquisition module 403 and redirect module 404, wherein:
Operation acquisition module 401 is for obtaining the clicking operation of the neutron navigation area, navigation area to webpage.
In the present embodiment, webpage comprises navigation area and content viewing area.Navigation area and content viewing area be the separate subregion of two in corresponding webpage source code respectively.The web page contents showing in content viewing area is called space of a whole page content, and content viewing area comprises the scroll bar moving for controlling space of a whole page content.The space of a whole page content showing in content viewing area changes along with the movement of scroll bar.Navigation area comprises multiple sub-navigation areas.In sub-navigation area, show the flag information of corresponding space of a whole page content.In one embodiment, the position pattern of navigation area is " fixed " pattern, and this pattern can make the position of navigation area in webpage immobilize.
The anchor point that clicking operation anchor point acquisition module 402 links for obtaining sub-navigation area corresponding to clicking operation.
In one embodiment, can be in advance in the source code of content viewing area precalculated position anchor point is set.For example, to be called the anchor point that " nav_name1 ", ID are " nav_id1 " as follows: <aname=name can be set " nav_name1 " id=" nav_id1 " ></a>.The anchor point arranging can be divided into multiple source code block by the source code of content viewing area, some anchor points are the source code block that this anchor point is corresponding to the source code block between its next anchor point, and last anchor point to the source code block between the source code end of content viewing area is the source code block that this last anchor point is corresponding.
Further, can be each sub-navigation area the link of pointing to some anchor points is set.Concrete, the link of pointing to some anchor points can be set in the source code of each sub-navigation area.For example, can in the source code of a certain sub-navigation area, arrange one point to above-mentioned ID for " nav_id1 " and the link of anchor point: <a href=" #nav_id1 " >, the anchor point that this sub-navigation area links be above-mentioned ID for " nav_id1 " and anchor point.
Clicking operation anchor point acquisition module 402 can be searched title or the ID of the anchor point comprising in the source code of sub-navigation area corresponding to clicking operation.
Webpage position acquisition module 403 is for obtaining linked anchor point in webpage position corresponding to the space of a whole page content of the content viewing area of webpage.
Concrete, webpage position acquisition module 403 can be searched title or the ID of above-mentioned anchor point in the source code of content viewing area, the webpage position of this position of the position acquisition in the source code of content viewing area correspondence in the space of a whole page content of content viewing area according to the title of this anchor point or ID.
Redirect module 404 is for jumping to the space of a whole page content of the content viewing area of webpage the webpage position of above-mentioned correspondence.
Concrete, redirect module 404 can move to the above-mentioned webpage position of the space of a whole page content the top of content viewing area.
In one embodiment, as mentioned above, content viewing area comprises the scroll bar moving for controlling space of a whole page content.Above-mentioned web page contents positioning system also comprises scroll bar mobile module (not shown), moves the position of scroll bar at scrolling bar for the webpage position obtaining according to webpage position acquisition module 403.
For example, above-mentioned webpage position is positioned at the middle part of space of a whole page content, and scroll bar mobile module can move to scroll bar the middle part of scrolling bar.
As shown in Figure 5, in one embodiment, above-mentioned web page contents positioning system also comprises sub-navigation area anchor point acquisition module 501, source code block acquisition module 502, flag information acquisition module 503 and display module 504:
The anchor point that sub-navigation area anchor point acquisition module 501 links for obtain the sub-navigation area of navigation area at the source code of navigation area.
In one embodiment, sub-navigation area anchor point acquisition module 501 can be searched title or the ID of the anchor point comprising in the source code of each sub-navigation area, and this title or ID are title or the ID of the anchor point that corresponding sub-navigation area links.
Source code block corresponding to anchor point that source code block acquisition module 502 links for obtain sub-navigation area at the source code of content viewing area.
In one embodiment, source code block acquisition module 502 can be searched the next anchor point of the anchor point that sub-navigation area links in the source code of content viewing area, obtains source code block corresponding to anchor point that anchor point that sub-navigation area links links for this sub-navigation area to the source code block between its next anchor point.If found the source code end of content viewing area but do not found next anchor point, obtain source code block corresponding to anchor point that anchor point that sub-navigation area links links for this sub-navigation area to the source code block between the source code end of content viewing area.
Flag information acquisition module 503 obtains corresponding source code block resolves the flag information of the space of a whole page content forming.
In one embodiment, the flag information of space of a whole page content comprises the segment word in thumbnail or the space of a whole page content of space of a whole page content.Concrete, flag information acquisition module 503 can use sectional drawing instrument to carry out sectional drawing to space of a whole page content, obtains the thumbnail of space of a whole page content.
Display module 504 is for showing the flag information of space of a whole page content in the sub-navigation area of correspondence.
The above embodiment has only expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.