Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report