繁體
|
簡體
Sclub交友聊天~加入聊天室當版主
(檢舉)
分享
新浪微博
QQ空间
人人网
腾讯微博
Facebook
Google+
Plurk
Twitter
Line
标题:
首页N格免安装、不调用flash版
[打印本页]
作者:
flashroad
时间:
2018-8-31 13:52
标题:
首页N格免安装、不调用flash版
【版权】
http://icode.258club.com/thread-46-1-1.html
【说明】
sclub官方提供了 首页N格(缓存版) 的安装和使用,你必须去sclub后台【注意:不是discuz后台】申请安装该插件,然后经过超长时间的等待,才可以在discuz后台【就是我们经常说的后台】配置使用。
本教程就是免除插件安装的,直接按照下面的步骤做,就可以轻松搞定了。
本N格只是将 缓存版的 flash调用图片轮播进行了替换,不需要使用flash,如此一来,在手机端也可以看到图片轮播了
作者:
flashroad
时间:
2018-8-31 13:57
标题:
一、导入数据调用文件
[attach]1147[/attach]
将这个xml格式的附件下载,然后进入自己论坛的后台,依次单击:
工具>数据调用>导入
将这个xml文件导入即可
作者:
flashroad
时间:
2018-8-31 13:59
标题:
二、新建i_js1模板
/*
常用页面效果,基于jquery,所有obj对象可用jquery选择器
Author: cosa
Creation Date: 2008-12-23
Updated Date: 2009-1-7
*/
/*
==slightbox==
属性{对象|关闭对象|不透明度[为0时不显示背景]|关闭延迟}
*/
function slightbox(obj,oclose,opacity,ctime){
var _this = this;
_this.d = jQuery(obj);
var mkdiv
_this.cenvelop = function(){
if(opacity){
mkdiv = document.createElement("div");
jQuery(mkdiv).css({position:"absolute",zIndex:"9998",left:"0",top:"0",right:"0",width:"100%",background:"#000000"});
jQuery("body").append(jQuery(mkdiv));
jQuery(mkdiv).css("opacity",opacity);
}
_this._resize();
}
_this._resize = function(){
jQuery(mkdiv).css("height",Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight) + "px");
jQuery(mkdiv).css("width",document.documentElement.clientWidth + "px");
var _x = Math.round((document.documentElement.clientWidth-this.d.width())/2);
var _y = Math.round((document.documentElement.clientHeight-this.d.height())/2);
_this.d.css({"position":"absolute","zIndex":"9999","left":_x+"px","top":_y+"px"});
}
_this.closed = function(){
jQuery(mkdiv).remove();
_this.d.remove();
return false;
}
var sctop = 0;
jQuery(window).resize(function(){
_this._resize();
});
var top = (document.documentElement.clientHeight-this.d.height())/2;
jQuery(window).scroll(function(){
jQuery(obj).css("top",document.documentElement.scrollTop - sctop + top + "px");
sctop = document.documentElement.scrollTop;
top = parseInt(jQuery(obj).css("top"));
});
if(ctime){
setTimeout(_this.closed, ctime)
}
jQuery(oclose).click(function(){_this.closed();})
_this.cenvelop();
}
/*
/*
==轮播{对象|对象属性}==
对象属性{宽度|高度|文字大小|自动切换时间}
*/
function dk_slideplayer(object,config){
this.obj = object;
this.config = config ? config : {width:"300px",height:"200px",fontsize:"12px",right:"10px",bottom:"10px",time:"5000"};
this.pause = false;
var _this = this;
if(!this.config.right){
this.config.right = "0px"
}
if(!this.config.bottom){
this.config.bottom = "1px"
}
if(this.config.fontsize == "12px" || !this.config.fontsize){
this.size = "12px";
this.height = "21px";
this.right = "6px";
this.bottom = "10px";
}else if(this.config.fontsize == "14px"){
this.size = "14px";
this.height = "50px";
this.right = "6px";
this.bottom = "15px";
}
this.count = jQuery(this.obj + " li").size();
this.n =0;
this.j =0;
var t;
this.factory = function(){
jQuery(this.obj).css({position:"relative",zIndex:"0",margin:"0",padding:"0",width:this.config.width,height:this.config.height,overflow:"hidden"})
jQuery(this.obj).prepend("<div style='position:absolute;z-index:20;right:"+this.config.right+";bottom:"+this.config.bottom+"'></div>");
jQuery(this.obj + " li").css({width:"100%",height:"100%",overflow:"hidden"}).each(function(i){jQuery(_this.obj + " div").append("<a>"+(i+1)+"</a>")});
jQuery(this.obj + " img").css({border:"none",width:"100%",height:"100%"})
this.resetclass(this.obj + " div a",0);
jQuery(this.obj + " p").each(function(i){
jQuery(this).parent().append(jQuery(this).clone(true));
jQuery(this).html("");
jQuery(this).css({position:"absolute",margin:"0",padding:"0",zIndex:"1",top:"0",left:"0",height:_this.height,width:"100%",background:"#0080FF",opacity:"0.4",overflow:"hidden"})
jQuery(this).next().css({position:"absolute",margin:"0",padding:"0",zIndex:"2",top:"0",left:"0",height:_this.height,lineHeight:_this.height,textIndent:"5px",width:"100%",textDecoration:"none",fontSize:_this.size,color:"#FFFFFF",background:"none",zIndex:"1",opacity:"1",overflow:"hidden"})
if(i!= 0){jQuery(this).hide().next().hide()}
});
this.slide();
this.addhover();
t = setInterval(this.autoplay,this.config.time);
}
this.slide = function(){
jQuery(this.obj + " div a").mouseover(function(){
_this.j = jQuery(this).text() - 1;
_this.n = _this.j;
if (_this.j >= _this.count){return;}
jQuery(_this.obj + " li").hide();
jQuery(_this.obj + " p").hide();
jQuery(_this.obj + " li").eq(_this.j).fadeIn("slow");
jQuery(_this.obj + " li").eq(_this.j).find("p").show();
_this.resetclass(_this.obj + " div a",_this.j);
});
}
this.addhover = function(){
jQuery(this.obj).hover(function(){clearInterval(t);}, function(){t = setInterval(_this.autoplay,_this.config.time)});
}
this.autoplay = function(){
_this.n = _this.n >= (_this.count - 1) ? 0 : ++_this.n;
jQuery(_this.obj + " div a").eq(_this.n).trigger('mouseover');
}
this.resetclass =function(obj,i){
jQuery(obj).css({float:"left",marginRight:"1px",width:"22px",height:"15px",lineHeight:"15px",textAlign:"center",fontWeight:"800",fontSize:"12px",color:"#FFFFFF",background:"#999",cursor:"pointer",opacity:"0.8"});
jQuery(obj).eq(i).css({color:"#FFFFFF",background:"#0080FF",textDecoration:"none",width:"32px"});
}
this.factory();
}
/*
选项卡|显示隐藏层
选项卡属性设置: {mobj:"#m1",mchild:"li",mclass:"tds",eobj:"#m2",echild:"div",first:"1"};
mobj: 触发鼠标事件
*/
function optioncard(config){
this.config = config;
var _this = this;
this.resetall = function(i){
if(!this.config.mchild && !this.config.echild){
if(i==0){
jQuery(_this.config.mobj).removeClass(_this.config.mclass);
jQuery(_this.config.eobj).hide();
return;
}
if(i==1){
jQuery(_this.config.mobj).addClass(_this.config.mclass);
jQuery(_this.config.eobj).show();
return;
}
}else{
jQuery(this.config.mobj).find(this.config.mchild).removeClass(this.config.mclass);
jQuery(this.config.eobj).find(this.config.echild).hide();
jQuery(this.config.mobj).find(this.config.mchild).eq(i).addClass(this.config.mclass);
jQuery(this.config.eobj).find(this.config.echild).hide().eq(i).show();
}
}
if(this.config.mchild && this.config.echild){
if(!this.config.first) this.config.first = 1;
this.resetall(this.config.first-1);
jQuery(this.config.mobj).find(this.config.mchild).each(function(i){
jQuery(this).mouseover(function(){
_this.resetall(i);
})
})
}else{
jQuery(this.config.mobj).hover(function(){_this.resetall(1)},function(){_this.resetall(0)});
jQuery(this.config.eobj).hover(function(){_this.resetall(1)},function(){_this.resetall(0)});
}
}
复制
作者:
flashroad
时间:
2018-8-31 14:07
标题:
三、新建jq库
这里,你有两种选择,请任选其一。不要同时都选择!
选择一:
已经在自己的论坛内安装了jq库的朋友,请无视本楼
===================================================
选择二:
没有安装过jq库的朋友,你有两种选择【请单选,不要两个都选】:
【1】建议你安装jq库,因为这个东西需要经常使用:,打开下帖安装即可:
http://flashroad.joinbbs.net/thread-970-1-1.html
注意,只看上贴的2楼! 3楼不用管【除非你需要用章鱼之家的jq库,那就只看3楼,不要看2楼】
`````````````````````````````````````````````
【2】如果你不想安装jq库,请新建一个i_js2的模板,内容就是jq库的所有代码,你可以打开这个网址:
http://flashroad.joinbbs.net/templates/default/jquery.htm
将里面的所有代码复制、粘贴到这个i_js2的模板内即可
作者:
flashroad
时间:
2018-8-31 14:08
标题:
四、新建i_xshow 模板
说明,这个新建的模板内需要添加下面的内容
代码中的2、3两行,需要将default修改为自己风格对应的名字
第3行中的templates/default/i_js2.htm就是楼上的jq库。 如果你安装了jq库,请去掉整个第3行
<script type="text/javascript" src="images/xshow/title.js"></script>
<script type="text/javascript" src="templates/default/i_js1.htm" ></script>
<script type="text/javascript" src="templates/default/i_js2.htm" ></script>
<style type="text/css">
.xshow{width:99.9%;margin:0 auto 4px;padding:5px 0 2px 0;background:{WRAPBG};border:{WRAPBORDER} solid {WRAPBORDERCOLOR};}
.xshow table {background:{WRAPBG};text-align:left;border:none;}
.xshow .header td{text-align:center;height:31px;border-bottom:3px solid {COMMONBORDER};}
.xshow .border{border-right:1px solid {COMMONBORDER};}
.xshow .txt_con td{padding:5px;}
.xshow .txt td{padding:0;vertical-align:top;}
.xshow .txt div{width:100%;height:20px;background:url('images/xshow/listbg.gif') repeat-x;overflow:hidden;}
.xshow .txt span{float:right;}
.xshow .fiveline{border-top:1px solid {COMMONBORDER};padding: 0 5px;}
.xshow .fiveline img{width:48px;heigth:48px;margin:2px 8px 0 0;border:1px solid {COMMONBORDER};}
.xshow li {list-style: none;}
</style>
<div class="xshow">
<table cellspacing="0" cellpadding="0" width="99%" align="center">
<tr class="header">
<td class="border"><h3>精彩图片</h3></td>
<td class="border"><h3>最新帖子</h3></td>
<td class="border"><h3>最新回复</h3></td>
<td class="border"><h3>精华帖子</h3></td>
<td><h3>会员排行</h3></td>
</tr>
<tr class="txt_con">
<td width="28%" class="border">
<div class="tlb-disma" id="tbca_01">
{eval request('仿火狼_精彩图片');}
<script type="text/javascript">new dk_slideplayer("#tbca_01",{width:"100%",height:"213px",fontsize:"12px",time:"5000"});</script>
</div>
</td>
<td width="20%" class="border">
<table cellpadding="0" cellspacing="0" class="txt">
<tr>
<td><img src="images/xshow/list.gif" alt="" /></td>
<td width="100%">
{eval request('i_最新主题');}
</td>
</tr>
</table>
</td>
<td width="20%" class="border">
<table cellpadding="0" cellspacing="0" class="txt">
<tr>
<td><img src="images/xshow/list.gif" alt="" /></td>
<td width="100%">
{eval request('i_最新回复');}
</td>
</tr>
</table>
</td>
<td width="20%" class="border">
<table cellpadding="0" cellspacing="0" class="txt">
<tr>
<td><img src="images/xshow/list.gif" alt="" /></td>
<td width="100%">
{eval request('i_精华帖子');}
</td>
</tr>
</table>
</td>
<td>
<table cellpadding="0" cellspacing="0" class="txt">
<tr>
<td><img src="images/xshow/list.gif" alt="" /></td>
<td width="100%">
{eval request('i_金币飙升榜');}
</td>
</tr>
</table>
</td>
</tr>
</table>
{eval request('i_新会员');}
</div>
复制
作者:
flashroad
时间:
2018-8-31 14:15
标题:
五、修改discuz模版
找到
$pluginhooks[index_header]
在它的下边加
{template i_xshow}
就可以了!
【特别说明】如果你之前安装并使用了sclub官方提供的 首页N格(缓存版) ,填上上面的代码后,就会出现两个N格,此时需要先去掉首页N格(缓存版)
方法是:还是在discuz模版 找到并删除{template xshow}即可
作者:
flashroad
时间:
2018-8-31 14:19
标题:
补充说明
如果想自定义显示的版块,请至后台
工具>数据调用>[i]
发现有如下5个项目:
新会员
最新主题
最新回复
精华帖子
金币飙升榜
点击某一个项目右边的“编辑”
就可以设置了
进入编辑后,你可以设置调用的版块 等信息,非常方便
欢迎光临 flash之路-flash技术交流 (http://flashroad.joinbbs.net/)
Powered by Discuz! 7.2