yanght75 发表于 2012-4-18 10:47:45

织梦dedecms网站怎么使用键盘翻页代码呢?

织梦dedecms模板网站怎么使用键盘翻页代码呢?
这个功能在很多小说站,图片站经常用到,大家可以去留意一下哦!
下面来讲讲具体的修改操纵:
首先我们打开 include/arc.archives.class.php 查找到以下代码:
$this->PreNext['pre'] = "上一篇:{$preRow['title']} ";
替换成以下代码:
$this->PreNext['pre'] = "$mlink ";
$this->PreNext['next'] = "下一篇:{$nextRow['title']} ";
这样php代码就修改完了可以保存,接下来我们在内容页用js进行调用.把以下代码:


function getElement(aID)
{
return (document.getElementByIdx_x) ? document.getElementByIdx_x(aID): document.all;
}
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;
}

加到之前的位置.这样就全部修改完了,之后我们就可以更新文档看看是怎么样的效果了。
页: [1]
查看完整版本: 织梦dedecms网站怎么使用键盘翻页代码呢?