Get the App
SLTechnology News&Howtos  ›  Development  › 

How does css jump to a page

Shulou Source: shulou.com Published: 2022-06-01 12:48:04 10月27日 Update

This article editor for you a detailed introduction of "css how to jump to the page", the content is detailed, the steps are clear, the details are handled properly, I hope this "css how to jump to the page" article can help you solve your doubts, following the editor's ideas slowly in-depth, let's learn new knowledge.

1. Html implementation

The code is as follows:

Our implementation of this method will be relatively simple, but the deficiency is that it cannot be used in Struts Tiles.

2. JavaScript implementation

The code is as follows:

/ / jump directly to _ window.location.href='hello.html';// in the following ways: regularly jump to setTimeout in the following ways ("_ javascript:location.href='hello.html'", 5000)

By using the JavaScript method, it is more flexible and allows us to combine more other functions, but the drawback is that it will be affected by different browsers.

3. Implement the reciprocal JavaScript in firefox.

The code is as follows:

Var second = document.getElementById ('totalSecond'). TextContent; setInterval ("redirect ()", 1000); function redirect () {document.getElementById (' totalSecond'). TextContent =-- second; if (second)

< 0) location.href = 'hello.html'; } 4、解决Firefox不支持innerText的问题 代码如下所示: 5 if(navigator.appName.indexOf("Explorer") >

-1) {document.getElementById ('totalSecond'). InnerText = "my text innerText";} else {document.getElementById (' totalSecond'). TextContent = "my text textContent";}

5. Integration

5 var second = document.getElementById ('totalSecond'). TextContent; if (navigator.appName.indexOf ("Explorer") >-1) {second = document.getElementById (' totalSecond'). InnerText;} else {second = document.getElementById ('totalSecond'). TextContent;} setInterval ("redirect ()", 1000); function redirect () {if (second)

< 0) { location.href = 'hello.html'; } else { if (navigator.appName.indexOf("Explorer") >

-1) {document.getElementById ('totalSecond'). InnerText = second--;} else {document.getElementById (' totalSecond'). TextContent = second--;}

Summary: the above examples are mainly used to automatically jump to the hello.html file in the same directory after five seconds.

After reading this, the article "how to jump to the page of css" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, please follow the industry information channel.

Tags: Code pages articles content ways methods more different appropriate examples functions summary that is ideas files new knowledge steps browsers directories knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MariaDB OPPO Reno macOS Redmi