首页幻灯片代码之一
思良:原来就是用这个首页幻灯片代码,不过点击大图时链接有问题,如果是动态内容页,链接就错误,是静态页面还是正常的。
安装方法:后台点模版,找到公共模版变量,点击管理模版变量,增加一个模版变量,把下面的代码拷贝进去,随便命名一个名字,比如hdp,这样调用时就是[!--temp.hdp--],把这个代码插入到首页模版放置首页幻灯片的地方,这样就可以显示了。下面的代码是灵动标签,只能显示一级推荐的图片,大家可以自己改改灵动标签。
效果图:
代码:
<div class="flash_ind"> <div style="margin:6px"><style>.div_jflash {width:400px; height:410px; margin:0px; display:inline; float:left; position:relative; overflow:hidden;} .div_jimg {width:400px; height:300px; margin:0px auto 0px auto; text-align:center;} .div_jimg #a_jimg {width:400px; height:300px; display:block; margin:0px auto;} .div_jimg #bigimg {width:400px; height:300px; margin:0px; padding:0px;} .div_jimg .ul_jimg {padding:0px; display:inline; float:left; overflow:hidden; zoom:1; margin:0px; list-style:none; width:100%;} .div_jimg .ul_jimg li {display:inline; float:left; margin:10px 20px 0px 0px; width:80px; height:84px; background:url(page_01.gif) no-repeat center bottom; cursor:pointer;} .div_jimg .ul_jimg li img {width:92px; height:67px; padding:1px; border:#FBDBE9 1px solid;} .div_jimg .ul_jimg .on img {border:#0860a3 3px solid; width:92px; height:67px;} .div_jtt {position:absolute; top:276px; left:0px; width:400px; text-align:center; height:24px; padding-top:0px; background:#0860a3; filter:alpha(opacity=80); -moz-opacity:0.6; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; word-break:break-all;} .div_jtt a {font-weight:100; font-size:12px; color:#fff; line-height:24px} img{border:0px;} </style> <table id="pictable" style="DISPLAY: none"> <!----> [e:loop={0,4,3,1,'isgood=1','newstime DESC'}] <tr> <td><img src="<?=$bqr['titlepic']?>" border="0"/></td> <td><?=$bqr['title']?></td> <td><?=$bqsr['titleurl']?></td> </tr> [/e:loop] <!----> </table> <div class="div_jflash"><SCRIPT LANGUAGE="JavaScript"> <!-- var currslid = 0; var slidint; function setfoc(id){ document.getElementById("bigimg").src =picarry[id]; document.getElementById("a_jimg").href =lnkarry[id]; document.getElementById("div_jtt").innerHTML = '<a href="'+lnkarry[id]+'" target="_blank">'+ttlarry[id]+'</a>'; if (id==4) { document.getElementById("a_jimg").style.background = 'url('+picarry[0]+')'; } else { document.getElementById("a_jimg").style.background = 'url('+picarry[id+1]+')'; } currslid = id; for(i=0;i<4;i++){ document.getElementById("li_jimg"+i).className = "li_jimg"; }; document.getElementById("li_jimg"+id).className ="li_jimg on"; var borserInfo=navigator.userAgent.toLowerCase(); if(/msie/.test(borserInfo)) { document.getElementById("bigimg").style.visibility = "hidden"; document.getElementById("bigimg").filters[0].Apply(); document.getElementById("bigimg").filters[0].transition=23; if (document.getElementById("bigimg").style.visibility == "visible") { document.getElementById("bigimg").style.visibility = "hidden"; } else { document.getElementById("bigimg").style.visibility = "visible"; } document.getElementById("bigimg").filters[0].Play(); } stopit(); } function playnext(){ if(currslid==3){ currslid = 0; } else{ currslid++; }; setfoc(currslid); playit(); } function playit(){ slidint = setTimeout(playnext,2000); } function stopit(){ clearTimeout(slidint); } window.onload = function(){ playit(); } function playit01(){ document.getElementById("playStop").className = "stop"; playit(); } function stopit01(){ document.getElementById("playStop").className = "play"; stopit(); } var picarry = {}; var lnkarry = {}; var ttlarry = {}; function FixCode(str){ return str.replace("'","="); } var bigtable=document.getElementById("pictable"); var rl=bigtable.rows.length; var txt=""; for(var i=0;i<rl;i++){ picarry[i]=bigtable.rows[i].cells[0].childNodes[0].src; lnkarry[i]=bigtable.rows[i].cells[2].innerHTML; lnkarry[i] = lnkarry[i].replace(/&/g,'&'); ttlarry[i]=FixCode(bigtable.rows[i].cells[1].innerHTML); } document.write("<div class='div_jimg'><a class='a_jimg' id='a_jimg' href='"+lnkarry[0]+"' title='' target='_blank'><img id='bigimg' style='filter:RevealTrans (duration='1',transition='23'); visibility:visible;' alt='' src='"+picarry[0]+"'></a><ul class='ul_jimg'><li class='li_jimg on' id='li_jimg0' onm ouseover='setfoc(0)' onm ouseout='playit()'><a href='"+lnkarry[0]+"' target='_blank' class='img'><img src='"+picarry[0]+"'></a></li><li class='li_jimg' id='li_jimg1' onm ouseover='setfoc(1)' onm ouseout='playit()'><a href='"+lnkarry[1]+"' target='_blank' class='img'><img src='"+picarry[1]+"'></a></li><li class='li_jimg' id='li_jimg2' onm ouseover='setfoc(2)' onm ouseout='playit()'><a href='"+lnkarry[2]+"' target='_blank' class='img'><img src='"+picarry[2]+"'></a></li><li class='li_jimg' id='li_jimg3' onm ouseover='setfoc(3)' onm ouseout='playit()'><a href='"+lnkarry[3]+"' target='_blank' class='img'><img src='"+picarry[3]+"'></a></li></ul></div><div class='div_jtt' id='div_jtt'><a href='"+lnkarry[0]+"' target='_blank'>"+ttlarry[0]+"</a></div>"); document.close(); --> </script> </div></div> </div> |