<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<a onclick="cc()" style=""> location </a>
<a href="#nizhaodao"> location 2 Number </a>
<div>
I am a 2 Page No
</div>
<div id="aa" class="aa" style="display:none">
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div id="nizhaodao" name="nizhaodao"> Come to me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
<div> Locate me </div>
</div>
 
<script>
// obtain URL Specify the parameters
function GetQueryString(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);//search, Inquire about ? Later parameters , And match regular
if(r!=null)return unescape(r[2]); return null;
}
var none=GetQueryString("a");
console.log(none);
if(none==0){
var bb=document.getElementById("aa");
bb.style.display="block";
window.onload=function(){
location.href ="#nizhaodao";
var oBox = document.getElementById("nizhaodao"); // To flash div id
var timer = null; // Define timers
var i = 0;
clearInterval(timer); // Clear the timer first
oBox.onmouseover = function(){ // When the mouse moves in div when Empty the timer
clearInterval(timer);
};
timer = setInterval(function () {
oBox.style.background = i++ % 2 ? "blue" : "#fff"; // Regular control div The display and concealment of information
i > 4 && (clearInterval(timer)) // Control the number of flashes
}, 400 );
}
}
function cc(id){
// window.location.hash = "#nizhaodao";
location.href ='#'+id;
console.log(" This method comes in ");
}
// console.log(a);
function aa(){
var stateObject = {};
var title = " Change address ";
var newUrl = 'file:///E:/temp/url2.html?a=1&b=1';
// Change the address in the address bar
history.pushState(stateObject, title, newUrl);
}
aa();
</script>
</body>
</html>

js More articles on hyperlink anchor location

  1. js Achieve anchor positioning

    js The principle of anchor positioning is , Calculate the height of the tag from the top , Click on the trigger tab , Reset the height of the scroll bar to the specified position . <!DOCTYPE html> <html> <head> ...

  2. html Inaccurate anchor positioning

    Problem description When the top is fixed , Click on the anchor , Will jump below the anchor . <style> #one,#two,#three{ height: 500px; } #top{ position: fixed; h ...

  3. html There are several common methods of setting anchor point positioning in (# It's positioning )

    stay html There are several ways I know how to set anchor points in , Here I'd like to share with you : 1. Use id location : <a href="#1F"> Anchor point 1</a> <div id=&q ...

  4. Wechat applet is based on scroll-view Achieve anchor positioning

    The code address is as follows :http://www.demodashi.com/demo/14009.html One . Preparatory work Software environment : WeChat developer tools Official download address :https://mp.weixin.qq.co ...

  5. html The role of anchors and js Use of tab anchor jump

    location yes javascript Built in objects that manage the address bar , such as location.href Just manage the page url, use location.href=url You can redirect the page directly url. and location. ...

  6. html Anchor positioning

    stay html There are several ways I know how to set anchor points in . Here I'd like to share with you : 1. Use id location : <a href="#1F" name="1F"> Anchor point 1< ...

  7. front end 1-----HTML understand , inline tag ( picture , Hyperlink anchor , Hyperlinked email )

    front end 1-----HTML understand , inline tag ( picture , Hyperlink anchor , Hyperlinked email ) 1. Self customization B/S # -*-coding:utf-8-*- # Author:Ds import socket IP_PORT= ...

  8. jquery The roller rolls Navigation positioning and anchor positioning

    His writing , Only tested ie9+, firefox,chrome following js Better var fixbar={ init:function(){ "use strict"; // Roller shaft Navigation position ...

  9. Using anchor positioning does not change url At the same time, slide smoothly to the anchor position , It won't go straight to the anchor point

    Using anchor positioning does not change url At the same time, slide smoothly to the anchor position , It won't go straight to the anchor point Anchor is a good technology for the front end , It can quickly locate the pre buried position . But the fly in the ointment is that it changes the request address url, When the user uses the anchor's ...

Random recommendation

  1. JVM Study (2)—— Heap is often said in technical articles , Stack , What is the stack , from os From the perspective of

    It is said that , Write your own code ,6 It's someone else's code after a month …… review ! review ! review ! The knowledge points involved are summarized as follows : Stack is stack JVM Stack and local method stack partition Java Heap in , Stack and c/c++ Heap in , Stack Heap at the data structure level , Stack os level ...

  2. Fudan advanced algebra II(15 level ) Thinking questions

    1. set up $f(x)=x^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0$ It's the first polynomial with integral coefficients , Satisfy : $|a_0|$ Is prime and $$|a_0|>1+\sum_{i=1}^{n ...

  3. websphere How to change back to Chinese

    I came in today and found ,websphere It's English in the browser . This is because my browser is missing a Chinese language setting , It has nothing to do with page coding . terms of settlement : IE Right click browser properties -- internet Options --   routine -- ...

  4. Spring MVC Use @ResponseBody return JSON data 406 And solutions to garbled code problems

    Just arrived at a company , Do the original work --- Interface , I'm the only one in the program , No environment , No architecture , There's no old project to take advantage of , Everything from 0 Start , The manager thinks I'm an old bird , Come on, set up the task , It's going to take a week to come up with the results . In fact, if there is a ready-made architecture, it is not a matter of minutes to write an interface , The key ...

  5. sublime And Emment

    sublime And Emment As a developer , It must have been used sublime and Emment All of them are delicious , It's a combination of the two . It not only improves the speed of coding, but also makes developers feel the pleasure and comfort of coding , I'm going to write today ...

  6. 【JVM.2】 Garbage collector and memory allocation strategy

    What the garbage collector needs to do 3 thing : What memory needs to be recycled ? When to recycle ? How to recycle ? In the previous section java All parts of the memory runtime area , Where the program counter . Virtual machine stack . Native Method Stack 3 Regions are generated with threads , Die with thread : Stack ...

  7. java Problems with installation configuration

    Error: could not open `C:\Program Files\Java\jre6\lib\i386\jvm.cfg') jdkerror  A few days ago, I installed a jdk7 Give it a try , Later, the project needs ...

  8. One Filter Need to configure multiple url-pattern

    Recently I came across a Filter Need to configure multiple url-pattern, I checked the information on the Internet , After testing , Now to sum up One . Completely wrong way Java Code <filter> <filter-name> ...

  9. Codeforces Round #437 (Div. 2)[A、B、C、E]

    Codeforces Round #437 (Div. 2) codeforces 867 A. Between the Offices( water ) The question : We know where the day is ( You may fly to other places in the evening ), Ask whether from ...

  10. B: One of world of Warcraft : Prepare for war

    describe West of world of Warcraft is the headquarters of the Red Devils , To the East is the headquarters of the blue devils . Between the two headquarters are a number of cities in turn .  Red command ,City 1,City 2,……,City n, Blue command The headquarters of both armies make samurai . The samurai have a total of ...