改变dede首幻灯片页 默认样式,简单使用 + 演示图
如遇下载链接蓝奏网盘打不开lanzous替换成lanzoux尝试! 广告
实现目标:改变 dede 首页幻灯片 默认样式,可自定义宽度和高度
使用方法:将文本(dede 首页幻灯片 样式修改 .txt)中的文件全部复制 替换掉 首页模板 中相关代码即可。
效果图:
附件隐藏,回复可见。
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
另附:精美的DEDECMS幻灯片展示,有演示截图案
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<script language=’javascript’>
linkarr = new Array();
picarr = new Array();
textarr = new Array();
var focus_width=305;
var focus_height=225;
var text_height=20;
var pics = “”;
var links = “”;
var texts = “”;
var swf_height = focus_height+text_height;
var defJpeg = “{dede:global name=’cfg_phpurl’/}/img/jpeg.jpg”;
//这里设置调用标记
{dede:arclist row=’5′ type=’image’ orderby=’id’}
linkarr[[field:global name=autoindex/]] = “[field:arcurl/]”;
picarr[[field:global name=autoindex/]] = “[field:picname/]”;
textarr[[field:global name=autoindex/]] = “[field:title function=’html2text(@me)’ /]”;
{/dede:arclist}
for(i=1;i<picarr.length;i++)
{if(picarr.indexOf(“jpg”)==-1 && picarr.indexOf(“JPG”)==-1) picarr = defJpeg;
if(pics==””) pics = picarr;
else pics += “|”+picarr;
}
for(i=1;i<linkarr.length;i++)
{if(links==””) links = linkarr;
else links += “|”+linkarr;
}
for(i=1;i<textarr.length;i++)
{if(texts==””) texts = textarr;
else texts += “|”+textarr;
}
document.write(‘<object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000″ codebase=”http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0″ width=”‘+ focus_width +'” height=”‘+ swf_height +'”>’);
document.write(‘<param name=”allowScriptAccess” value=”sameDomain”><param name=”movie” value=”/templets/flash/pixviewer.swf”>’);
document.write(‘<param name=”quality” value=”high”><param name=”bgcolor” value=”#ffffff”>’);
document.write(‘<param name=”menu” value=”false”><param name=wmode value=”opaque”>’);
document.write(‘<param name=”FlashVars” value=”pics=’+pics+’&links=’+links+’&texts=’+texts+’&borderwidth=’+focus_width+’&borderheight=’+focus_height+’&textheight=’+text_height+'”>’);
document.write(‘<embed src=”/templets/flash/pixviewer.swf” wmode=”opaque” FlashVars=”pics=’+pics+’&links=’+links+’&texts=’+texts+’&borderwidth=’+focus_width+’&borderheight=’+focus_height+’&textheight=’+text_height+'” menu=”false” bgcolor=”#ffffff” quality=”high” width=”‘+ focus_width +'” height=”‘+ focus_height +'” allowScriptAccess=”sameDomain” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” />’);
document.write(‘</object>’);
</script>
<!–flash开始–>
<script language=”javascript”>
//<![CDATA[
var $=function(objName)
{
if(document.getElementById)
{
return eval(‘document.getElementById(“‘+objName+'”)’)
}
else
{
return eval(‘document.all.’+objName)
}
}
function picData(pTitle,pImgSrc,pUrl)
{
this.title=pTitle;
this.imgSrc=pImgSrc;
this.url=pUrl;
this.showTitle=picData_doTitle;
}
function picData_doTitle()
{
var titleHtml=””;
titleHtml=”<a href='”+this.url+”‘ target=’_blank’ class=’f14white’>”+this.title+”</a>”;
return titleHtml;
}
var picArr=new Array();
{dede:arclist flag=’f’ row=’5′}
picArr[[field:global.autoindex/]-1]=new picData();
picArr[[field:global.autoindex/]-1].url = “[field:arcurl/]”;
picArr[[field:global.autoindex/]-1].imgSrc = “[field:litpic/]”;
picArr[[field:global.autoindex/]-1].title = “[field:title function=’html2text(@me)’/]”;
{/dede:arclist}
//初始化开始
var numHtml=””;
var numBgHtml=””;
var picDiv=””;
var curPicId=0;
var focusImgTime=5000;//切换时间间隔:单位毫秒
for(i=picArr.length;i>0;i–)
{
if (i==1)
{
numBgHtml+=”<label id=’picBtn”+(i-1)+”‘ class=’current’></label>”;
numHtml+=”<div class=’numDiv’><label id=’picNumBtn”+(i-1)+”‘ onclick=’javascript:clickPic(“+(i-1)+”)’ class=’current’>”+i+”</label></div>”;
}
else {
numBgHtml+=”<label id=’picBtn”+(i-1)+”‘></label>”;
numHtml+=”<div class=’numDiv’><label id=’picNumBtn”+(i-1)+”‘ onclick=’javascript:clickPic(“+(i-1)+”)’>”+i+”</label></div>”;
}
if(i==1)
{
picDiv+='<div id=”focusImgDiv’+(i-1)+'” class=”focusImgArea” style=”z-index:’+((picArr.length+1)*10)+'”><a href=”‘+picArr[(i-1)].url+'” target=”_blank”><img class=”picImg” src=”‘+picArr[(i-1)].imgSrc+'” width=”318″ height=”390″ alt=”” /></a></div>’;
}
else
{
picDiv+='<div id=”focusImgDiv’+(i-1)+'” class=”focusImgArea” style=”z-index:’+(i*10)+’;opacity:0;filter:alpha(opacity=0);”><a href=”‘+picArr[(i-1)].url+'” target=”_blank”><img class=”picImg” src=”‘+picArr[(i-1)].imgSrc+'” width=”318″ height=”390″ alt=”” /></a></div>’; //这里自定义幻灯片宽度和高度 width=”318″ height=”390″
}
}
$(‘numLink’).innerHTML=numHtml;
$(‘numBg’).innerHTML=numBgHtml;
$(‘focusImg’).innerHTML=picDiv;
$(“titleArea”).innerHTML=picArr[0].showTitle();
var myPicTime;
var animateOpacityTime;
myPicTime=setInterval(autoPicPlay,focusImgTime);
//初始化完成
function doPic(picId)
{
curPicId=picId;
for(z=0;z<picArr.length;z++)
{
if(eval($(“focusImgDiv”+z).style.zIndex)==(picArr.length+1)*10)//如果当前为最顶层图片,降到第二层
{
$(“focusImgDiv”+z).style.zIndex=(picArr.length+1)*10-5;
setOpacity(100,$(“focusImgDiv”+z));
}
else {$(“focusImgDiv”+z).style.zIndex=(z+1)*10;}
}
$(“focusImgDiv”+picId).style.zIndex=(picArr.length+1)*10;
setOpacity(0,$(“focusImgDiv”+picId));
myOpacity=0;
clearInterval(animateOpacityTime);
animateOpacityTime=setInterval(function(){animateOpacity($(“focusImgDiv”+picId))},10);
for(i=0;i<picArr.length;i++)
{
$(“picBtn”+i).className=$(“picBtn”+i).className.replace(‘current’,”);
$(“picNumBtn”+i).className=$(“picNumBtn”+i).className.replace(‘current’,”);
}
$(“picBtn”+picId).className+=” current”;
$(“picNumBtn”+picId).className+=” current”;
$(“picBtn”+picId).blur();
$(“titleArea”).innerHTML=picArr[picId].showTitle();
}
function setOpacity(opacity, theId) {
var object = theId.style;
if (navigator.userAgent.indexOf(“Firefox”) != -1) {
if (opacity == 100) { opacity = 99.9999; }
}
object.filter = “alpha(opacity=” + opacity + “)”; // IE/Win
object.opacity = (opacity / 100); // Safari 1.2, Firefox+Mozilla
}
var myOpacity=0;
function animateOpacity(obj)
{
myOpacity+=20;
setOpacity(myOpacity,obj);
if(myOpacity>=95)
{
setOpacity(100,obj);
clearInterval(animateOpacityTime);
}
}
function clickPic(cId)
{
clearInterval(myPicTime);
doPic(cId);
myPicTime=setInterval(autoPicPlay,focusImgTime);
}
function autoPicPlay()
{
curPicId++;
if(curPicId>=picArr.length)
{
curPicId=0;
}
doPic(curPicId);
}
//]]>
</script>
<!–flash结束–>
NOTICE:【咨询风格酷】客服微信:wwwxmamnet
NOTICE:【风格酷模板网②群】QQ群:288678775
☉免责声明:本站所有模板均来自用户分享和网络收集,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服,我们核实后会立即删除。
☉如果源码网盘地址失效!或有其他问题,请点我报错,谢谢合作!
☉人民币与积分汇率为1比10,即1元=10积分.有任何疑问请联系客服!
☉如有其他问题,请加网站客服QQ(1131734965)进行交流。
☉本站提供的源码、模板、软件工具等其他资源,都不包含技术服务,请大家谅解!
☉源码、模板等资源会随着技术、环境的升级而存在部分问题,还请慎重选择。