Get the App
SLTechnology News&Howtos  ›  Servers  › 

Dream weaving and pressing the keyboard direction key to realize the method of turning the page of the previous article and the next article

Shulou Source: shulou.com Published: 2022-06-02 05:00:43 10月01日 Update

I would like to share with you the method of weaving dreams and pressing the keyboard keys to realize the last article and the next page. I believe most people don't know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. let's learn about it!

How to turn the page of the previous article by pressing the keyboard key to weave a dream?

This function is often used in many novel stations and picture stations. You can pay attention to this. Let's talk about the specific modification methods to make weaving dreams turn up and down the page:

Implementation steps:

1. First of all, we open include/arc.archives.class.php and find the following code:

$this- > PreNext ['pre'] = "previous post: {$preRow [' title']}"

Replace with the following code:

$this- > PreNext ['pre'] = "$mlink"; $this- > PreNext [' next'] = "next article: {$nextRow ['title']}"

In this way, the php code can be modified and saved.

2. Next, we use js to call on the content page. Put the following code:

< !--_document.onkeydown = nextpage; var prevpage = '{dede:prenext get='pre '/}'; var nextpage = '{dede:prenext get='next '/}'; var index_page = "index.html"; //var bookpage="index.html"; function nextpage(event) { eventevent = event ? event: (window.event ? window.event: null); //if (event.keyCode==13) location=bookpage if (event.keyCode == 13) location = index_page if (event.keyCode == 37) { if (prevpage != '' && prevpage != '上一篇:没有了 ') location = prevpage; else alert('这是第一页'); } if (event.keyCode == 39) { if (nextpage != '' && nextpage != '下一篇:没有了 ') location = nextpage; else alert('已经是最后一页了'); } } //-->

Function getElement (aID) {return (document.getElementById)? Document.getElementById (aID): document.all [aID];} function makeRequest (url) {http_request = false; if (window.XMLHttpRequest) {/ / Mozilla,Safari,... Http_request = new XMLHttpRequest (); if (http_request.overrideMimeType) {http_request.overrideMimeType ('text/xml');}} else if (window.ActiveXObject) {/ / IE try {http_request = new ActiveXObject ("Msxml2.XMLHTTP");} catch (e) {try {http_request = new ActiveXObject ("Microsoft.XMLHTTP") } catch (e) {}} if (! http_request) {alert ('Giving up: (Cannot create an XMLHTTP instance)'); return false;} return http_request;}

Add it to the previous position. so it's all modified.

These are all the contents of Weaving Dream and pressing the keyboard key to realize the method of turning the page of the previous article and the next article. Thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Previous code direction method keyboard content finished article next not much location function picture picture station most novel effect more step Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi OPPO Reno Apple macOS Microsoft