【The content of the invention】
Based on this, it is 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 linked by the corresponding sub- navigation area of the clicking operation;
Obtain the anchor point corresponding web placement in the space of a whole page content of the content display area of webpage;
The space of a whole page content of the content display area of webpage is jumped to into the corresponding web placement;
The navigation area and the separate subregion that the content display area is webpage.
Wherein in one embodiment, the step of obtaining to the clicking operation of the neutron navigation area, navigation area of webpage it
Before, methods described also includes:
The anchor point linked by the sub- navigation area of navigation area is obtained in the source code of navigation area;
The corresponding source code block of the anchor point is obtained in the source code of content display area;
Obtain the flag information of the space of a whole page content of the source code block parsing;
The flag information is shown in corresponding sub- navigation area.
Wherein in one embodiment, the step of obtain the anchor point corresponding source code block it is:
Search the next anchor point of the anchor point in the source code of content display area, the anchor point is obtained to described next
Source code block between individual anchor point is the corresponding source code block of the anchor point;
If having found the source code end of content display area but not found the next anchor point, the anchor is obtained
Point to the source code block between the source code end of content display area is the corresponding source code block of the anchor point.
Wherein in one embodiment, the flag information includes the thumbnail of space of a whole page content or the part in space of a whole page content
Word.
Wherein in one embodiment, the content display area is included for controlling the scroll bar that space of a whole page content is moved;
It is after the step of space of a whole page content by the content display area of webpage jumps to the corresponding web placement, described
Method also includes:
Position of the scroll bar in scrolling bar is moved according to the web placement.
Additionally, there is a need to a kind of web page contents positioner that can improve web page contents locating speed of offer.
A kind of web page contents positioner, including:
Operation acquisition module, for obtaining the clicking operation of the neutron navigation area, navigation area to webpage;
Clicking operation anchor point acquisition module, for obtaining the anchor point linked by the corresponding sub- navigation area of the clicking operation;
Web placement acquisition module, it is corresponding in the space of a whole page content of the content display area of webpage for obtaining the anchor point
Web placement;
Jump module, for the space of a whole page content of the content display area of webpage is jumped to the corresponding web placement;
The navigation area and the separate subregion that the content display area is webpage.
Wherein in one embodiment, the system also includes:
Sub- navigation area anchor point acquisition module, the sub- navigation area for obtaining navigation area in the source code of navigation area are linked
Anchor point,
Source code block acquisition module, obtains the corresponding source code block of the anchor point in the source code of content display area;
Flag information acquisition module, for obtaining the flag information of the space of a whole page content of the source code block parsing;
Display module, for showing the flag information in corresponding sub- navigation area.
Wherein in one embodiment, the source code block acquisition module is for the lookup in the source code of content display area
The next anchor point of the anchor point, it is anchor point correspondence to obtain the anchor point to the source code block between the next anchor point
Source code block, if having found the source code end of content display area but not found the next anchor point, obtain institute
It is the corresponding source code block of the anchor point to state the source code block between the source code end of anchor point to content display area.
Wherein in one embodiment, the flag information includes the thumbnail of space of a whole page content or the part in space of a whole page content
Word.
Wherein in one embodiment, the content display area is included for controlling the scroll bar that space of a whole page content is moved;
The system also include scroll bar mobile module, for according to the web placement move scroll bar in scrolling bar
Position.
Above-mentioned web page contents localization method and device, webpage include that separate two subregion navigation area and content are aobvious
Show area, the space of a whole page content of content display area is navigated to correspondence web placement by the sub- navigation area that can be clicked in navigation area, so as to carry
The high locating speed of web page contents.
【Specific 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 includes navigation area and content display area.Navigation area and content display area corresponding webpage respectively
The separate subregion of two in source code.The web page contents shown in content display area are referred to as space of a whole page content, and content shows
Area is included for controlling the scroll bar that space of a whole page content is moved.The space of a whole page content shown in content display area is with the shifting of scroll bar
Move and change.Navigation area includes many sub- navigation areas.The flag information of corresponding space of a whole page content is shown in sub- navigation area.At one
In embodiment, the position patterns of navigation area are " fixed " pattern, and the pattern can cause position of the navigation area in webpage solid
It is fixed constant.
Step S102, obtains the anchor point linked by the corresponding sub- navigation area of clicking operation.
In one embodiment, can in advance in the source code of content display area precalculated position arrange anchor point.For example, can set
Put entitled " nav_name1 ", ID for " nav_id1 " anchor point it is as follows:<a name=”nav_name1”id=”nav_id1”>
</a>.The source code of content display area can be divided into multiple source code blocks by the anchor point of setting, and some anchor point is to its next anchor
Source code block between point is the corresponding source code block of the anchor point, the source code end of last anchor point to content display area it
Between source code block be the corresponding source code block of last anchor point.
Further, the link of some anchor point can be set to point to for each sub- navigation area.Specifically, can lead in each height
The link of some anchor point is set to point in the source code of navigating area.For example, one can be arranged in the source code of a certain sub- navigation area
It is individual to point to above-mentioned ID and be " nav_id1 " anchor point link:<Ahref=" #nav_id1 ">, then the sub- navigation area linked
Anchor point be above-mentioned ID be " nav_id1 " and anchor point.
Step S102 can search the title or ID of the anchor point for including in the source code of the corresponding sub- navigation area of clicking operation.
Step S103, obtains linked anchor point corresponding webpage position in the space of a whole page content of the content display area of webpage
Put.
Specifically, the title or ID of above-mentioned anchor point can be searched in the source code of content display area, according to the name of the anchor point
Claim or position acquisitions of the ID in the source code of the content display area position corresponding net in the space of a whole page content of content display area
Page position.
The space of a whole page content of the content display area of webpage is jumped to above-mentioned corresponding web placement by step S104.
Specifically, the above-mentioned web placement of space of a whole page content can be moved to the top of content display area.
In one embodiment, as mentioned above, content display area is included for controlling the movement of space of a whole page content
Scroll bar.After step s 104, above-mentioned web page contents localization method also includes step:According to the webpage position that step S103 is obtained
Put position of the mobile scroll bar in scrolling bar.
For example, above-mentioned web placement is located at the middle part of space of a whole page content, then scroll bar can be moved to the middle part of scrolling bar.
As shown in Fig. 2 in one embodiment, before step S101, above-mentioned web page contents localization method also includes life
Into and the step of show the flag information of space of a whole page content, its process is comprised the following steps:
Step S201, obtains the anchor point linked by the sub- navigation area of navigation area in the source code of navigation area.
In one embodiment, the title or ID of the anchor point for including can be searched in the source code of each sub- navigation area, should
Title or ID are the title or ID of the anchor point linked by corresponding sub- navigation area.
Step S202, obtains the corresponding source code of anchor point linked by sub- navigation area in the source code of content display area
Block.
In one embodiment, the next of the anchor point linked by sub- navigation area can be searched in the source code of content display area
Individual anchor point, the anchor point linked by the sub- navigation area of acquisition are linked to the source code block between its next anchor point by the sub- navigation area
The corresponding source code block of anchor point.If having found the source code end of content display area but not found next anchor point,
It is the sub- navigation area institute to obtain the source code block between the source code end of the anchor point to content display area linked by sub- navigation area
The corresponding source code block of anchor point of link.
Step S203, obtains the flag information of the space of a whole page content of corresponding source code block parsing.
In one embodiment, the flag information of space of a whole page content includes the portion in the thumbnail or space of a whole page content of space of a whole page content
Single cent word.Specifically, sectional drawing can be carried out to space of a whole page content using sectional drawing instrument, obtains the thumbnail of space of a whole page content.
Step S204, shows the flag information of space of a whole page content in corresponding sub- navigation area.
Fig. 3 is webpage layout schematic diagram in above-mentioned web page contents localization method in one embodiment.The content of webpage shows
Area 301 is located on the left of webpage, and the web page contents shown in content display area 301 are referred to as space of a whole page content.Navigation area 302 is located at webpage
Right side, navigation area 302 include many sub- navigation areas, and the thumbnail of correspondence space of a whole page content is shown in sub- navigation area.When user clicks on
During a certain sub- navigation area, the space of a whole page content of content display area jumps to the corresponding position in the sub- navigation area.
As shown in figure 4, in one embodiment, a kind of web page contents positioner, including operation acquisition module 401, point
Operation anchor point acquisition module 402, web placement acquisition module 403 and jump module 404 are hit, wherein:
Operation acquisition module 401 is used for the clicking operation for obtaining the neutron navigation area, navigation area to webpage.
In the present embodiment, webpage includes navigation area and content display area.Navigation area and content display area corresponding webpage respectively
The separate subregion of two in source code.The web page contents shown in content display area are referred to as space of a whole page content, and content shows
Area is included for controlling the scroll bar that space of a whole page content is moved.The space of a whole page content shown in content display area is with the shifting of scroll bar
Move and change.Navigation area includes many sub- navigation areas.The flag information of corresponding space of a whole page content is shown in sub- navigation area.At one
In embodiment, the position patterns of navigation area are " fixed " pattern, and the pattern can cause position of the navigation area in webpage solid
It is fixed constant.
Clicking operation anchor point acquisition module 402 is used to obtain the anchor point linked by the corresponding sub- navigation area of clicking operation.
In one embodiment, can in advance in the source code of content display area precalculated position arrange anchor point.For example, can set
Put entitled " nav_name1 ", ID for " nav_id1 " anchor point it is as follows:<aname=”nav_name1”id=”nav_id1”></
a>.The source code of content display area can be divided into multiple source code blocks by the anchor point of setting, and some anchor point is to its next anchor point
Between source code block be the corresponding source code block of the anchor point, between the source code end of last anchor point to content display area
Source code block be the corresponding source code block of last anchor point.
Further, the link of some anchor point can be set to point to for each sub- navigation area.Specifically, can lead in each height
The link of some anchor point is set to point in the source code of navigating area.For example, one can be arranged in the source code of a certain sub- navigation area
It is individual to point to above-mentioned ID and be " nav_id1 " anchor point link:<A href=" #nav_id1 ">, then the sub- navigation area linked
Anchor point be above-mentioned ID be " nav_id1 " and anchor point.
Clicking operation anchor point acquisition module 402 can search what is included in the source code of the corresponding sub- navigation area of clicking operation
The title or ID of anchor point.
Web placement acquisition module 403 is used to obtain linked anchor point in the space of a whole page content of the content display area of webpage
Corresponding web placement.
Specifically, web placement acquisition module 403 can search the title of above-mentioned anchor point in the source code of content display area
Or ID, the position acquisition position according to the title or ID of the anchor point in the source code of content display area is in content display area
Corresponding web placement in space of a whole page content.
Jump module 404 is for jumping to above-mentioned corresponding web placement by the space of a whole page content of the content display area of webpage.
Specifically, the above-mentioned web placement of space of a whole page content can be moved to jump module 404 the top of content display area.
In one embodiment, as mentioned above, content display area is included for controlling the movement of space of a whole page content
Scroll bar.Above-mentioned web page contents alignment system also includes scroll bar mobile module(Not shown in figure), for according to web placement
Position of the web placement movement scroll bar in scrolling bar that acquisition module 403 is obtained.
For example, above-mentioned web placement is located at the middle part of space of a whole page content, then scroll bar can be moved to by scroll bar mobile module
The middle part of scrolling bar.
As shown in figure 5, in one embodiment, above-mentioned web page contents alignment system also includes that sub- navigation area anchor point obtains mould
Block 501, source code block acquisition module 502, flag information acquisition module 503 and display module 504:
Sub- navigation area institute chain of the sub- navigation area anchor point acquisition module 501 for the acquisition navigation area in the source code of navigation area
The anchor point for connecing.
In one embodiment, sub- navigation area anchor point acquisition module 501 can be searched in the source code of each sub- navigation area
Comprising anchor point title or ID, the title or ID are the title or ID of the anchor point linked by corresponding sub- navigation area.
Source code block acquisition module 502 is for obtaining the anchor point linked by sub- navigation area in the source code of content display area
Corresponding source code block.
In one embodiment, source code block acquisition module 502 can search son navigation in the source code of content display area
The next anchor point of the anchor point linked by area, the anchor point linked by the sub- navigation area of acquisition is to the source code between its next anchor point
The corresponding source code block of anchor point that block is linked by the sub- navigation area.If having found the source code end but not of content display area
Next anchor point is found, then obtains the source generation between the source code end of the anchor point to content display area linked by sub- navigation area
The corresponding source code block of anchor point that code block is linked by the sub- navigation area.
Flag information acquisition module 503 obtains the flag information of the space of a whole page content of corresponding source code block parsing.
In one embodiment, the flag information of space of a whole page content includes the portion in the thumbnail or space of a whole page content of space of a whole page content
Single cent word.Specifically, flag information acquisition module 503 can carry out sectional drawing using sectional drawing instrument to space of a whole page content, obtain in the space of a whole page
The thumbnail of appearance.
Display module 504 is for showing the flag information of space of a whole page content in corresponding sub- navigation area.
Embodiment described above only expresses the several embodiments of the present invention, and its description is more concrete and detailed, but and
Therefore the restriction to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that for one of ordinary skill in the art
For, without departing from the inventive concept of the premise, some deformations and improvement can also be made, these belong to the guarantor of the present invention
Shield scope.Therefore, the protection domain of patent of the present invention should be defined by claims.