第一个是北京奥运官网的flash幻灯片
效果地址:http://www.beijing2008.cn/
前台调用:
<html>
<head>
<title>Flash 调用</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT src="{$InstallDir}Skin/beijing/flashobj.js" type=text/javascript></SCRIPT>
<SCRIPT type=text/javascript>
//<![CDATA[
function getObject(objectId) {
if(document.getElementById && document.getElementById(objectId)) {return document.getElementById(objectId);}
else if (document.all && document.all(objectId)) {return document.all(objectId); }
else if (document.layers && document.layers[objectId]) {return document.layers[objectId]; }
else {return false;}
}
//]]>
</SCRIPT>
</head>
<body>
{$MY_flash(1,520,205)}
</body>
</html>
{$MY_flash(1,520,205)} 参数分别是: 频道ID、flash宽、flash高
flashobj.js 文件下载:
点击浏览该文件
***********以下是函数标签部分************
查询语句:
select top 4 ArticleID,ChannelID,ClassID,Title,DefaultPicUrl from PE_Article where Status = 3 and ChannelID={input(0)} and (IncludePic=1 or IncludePic=2) and deleted=0 order by ArticleID desc
代码部分:
<DIV id=FlashFocus></DIV>
<SCRIPT type=text/javascript>
//<![CDATA[
txt="{Loop}{Infobegin}<a image='{$InstallDir}{$Field(1,GetChannel,1)}/{$Field(1,GetChannel,3)}/{$Field(4,Text,0,0,0)}' info='{$Field(3,Text,0,0,0)}' url='{$InstallDir}{$Field(0,GetUrl,Article,1)}'/>{Infoend}{/Loop}"
var peFlash2 = new peFlash("{$InstallDIr}Skin/beijing/demo.swf", "27", {input(1)}, {input(2)}, "7");
peFlash2.addParam("quality", "high");
peFlash2.addParam("wmode", "opaque");
peFlash2.addVariable("txt",txt);
peFlash2.write("FlashFocus");
//]]>
</SCRIPT>
******************************************************************************************************************************************
第二个是腾讯网的北京奥运专题的js幻灯片
效果地址:http://2008.qq.com/torchrelay/index.htm
前台调用:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Flash 调用</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
body,ul,li{padding:0; margin:0}
li{list-style:none;}
.box{
width:388px;
background:url(Skin/beijing/bg.jpg) left bottom no-repeat;
padding:5px;
}
.left,.button{
float:left;
width:65px;
}
.right,.tit{
float:right;
width:315px;
}
.right{
height:225px;
overflow:hidden;
}
.button,.tit{
padding-top:10px;
}
.button img{
cursor:pointer
}
.tit,.tit a,.tit a:link,.tit a:visited {
font: bold 14px/24px "宋体";
color:#fff;
text-decoration:none;
}
.tit a:hover {
color:#FF0;
text-decoration:underline;
}
.clearbox{
border-top: 1px solid transparent !important;
margin-top: -1px !important;
border-top: 0px;
margin-top: 0px;
height: 0px;
clear: both;
background: none;
font-size: 0px;
visibility: hidden;
}
</style>
</head>
<body>
{$MY_js(1,65,53,315)}
</body>
</html>
{$MY_js(1,65,53,315)} 参数分别是: 频道ID、小图宽、小图高、大图宽;这里没有固定大图的高是为了防止图片变形,在css样式里面已经定义了大图显示区域的大小,以使其超出其区域时隐藏;
***********以下是函数标签部分************
查询语句:
select top 4 ArticleID,ChannelID,ClassID,Title,DefaultPicUrl from PE_Article where Status = 3 and (IncludePic=1 or IncludePic=2) and ChannelID={input(0)} and deleted=0 order by ArticleID desc
代码部分:
<script type="text/javascript">
<!--{Loop}
{Infobegin}
imgUrl{$AutoID}="{$InstallDir}{$Field(1,GetChannel,1)}/{$Field(1,GetChannel,3)}/{$Field(4,Text,0,0,0)}"
imgLink{$AutoID}="{$InstallDir}{$Field(0,GetUrl,Article,1)}"
imgtext{$AutoID}="{$Field(3,Text,0,0,0)}"{Infoend}
{/Loop}
var small_width={input(1)}
var small_height={input(2)}
var big_width={input(3)}
document.write('<div class="box">');
document.write(' <div class="left"><ul>');
document.write(' <li onmouseover=Mea(0);clearAuto(); onmouseout=setAuto()>');
document.write(' <a href="'+imgLink1+'"><IMG class="imgbor3" src="'+imgUrl1+'" width='+small_width+' height='+small_height+' border=0></A>');
document.write(' </li>');
document.write(' <li onmouseover=Mea(1);clearAuto(); onmouseout=setAuto()>');
document.write(' <a href="'+imgLink2+'"><IMG class="imgbor3" src="'+imgUrl2+'" width='+small_width+' height='+small_height+' border=0></A>');
document.write(' </li>');
document.write(' <li onmouseover=Mea(2);clearAuto(); onmouseout=setAuto()>');
document.write(' <a href="'+imgLink3+'"><IMG class="imgbor3" src="'+imgUrl3+'" width='+small_width+' height='+small_height+' border=0></A>');
document.write(' </li>');
document.write(' <li onmouseover=Mea(3);clearAuto(); onmouseout=setAuto()>');
document.write(' <a href="'+imgLink4+'"><IMG class="imgbor3" src="'+imgUrl4+'" width='+small_width+' height='+small_height+' border=0></A>');
document.write(' </li>');
document.write(' </ul></div>');
document.write(' <div class="right" id=fc style="FILTER: progid:DXImagetransform.Microsoft.GradientWipe(duration=1,gradientSize=0.5,motion=forward );">');
document.write(' <div style="display:block">');
document.write(' <a href="'+imgLink1+'"><IMG class="imgbor1" src="'+imgUrl1+'" width='+big_width+' border=0></A>');
document.write(' </div>');
document.write(' <div style="display:none">');
document.write(' <a href="'+imgLink2+'"><IMG class="imgbor1" src="'+imgUrl2+'" width='+big_width+' border=0></A>');
document.write(' </div>');
document.write(' <div style="display:none">');
document.write(' <a href="'+imgLink3+'"><IMG class="imgbor1" src="'+imgUrl3+'" width='+big_width+' border=0></A>');
document.write(' </div>');
document.write(' <div style="display:none">');
document.write(' <a href="'+imgLink4+'"><IMG class="imgbor1" src="'+imgUrl4+'" width='+big_width+' border=0></A>');
document.write(' </div>');
document.write(' </div>');
document.write(' <div class="clearbox"></div>');
document.write(' <div id=con class="tit">');
document.write(' <div style="display:block;">');
document.write(' <a href="'+imgLink1+'">'+imgtext1+'</A>');
document.write(' </div>');
document.write(' <div style="display:none;">');
document.write(' <a href="'+imgLink2+'">'+imgtext2+'</A>');
document.write(' </div>');
document.write(' <div style="display:none;">');
document.write(' <a href="'+imgLink3+'">'+imgtext3+'</A>');
document.write(' </div>');
document.write(' <div style="display:none;">');
document.write(' <a href="'+imgLink4+'">'+imgtext4+'</A>');
document.write(' </div>');
document.write(' </div>');
document.write(' <div class="button">');
document.write(' <IMG onclick=foucs_start() src="{$InstallDir}Skin/beijing/but1.gif" width=19 height=19 align="absmiddle" border="0">');
document.write(' <IMG onclick=foucs_pause() src="{$InstallDir}Skin/beijing/but2.gif" width=19 height=19 align="absmiddle" border="0">');
document.write(' </div>');
document.write(' <div class="clearbox"></div>');
document.write('</div>');
var n=0;
function Mea(value){
n=value;
setBg(value);
plays(value);
con(n);
}
function setBg(value){
for(var i=0;i<4;i++)
if(value==i){
}
else{
}
}
function plays(value){
with (fc){
filters[0].Apply();
for(i=0;i<4;i++)i==value?children[i].style.display="block":children[i].style.display="none";
filters[0].play();
}
}
function con(value){
try
{
with (con){
for(i=0;i<4;i++)i==value?children[i].style.display="block":children[i].style.display="none";
}
}
catch(e)
{
var d = document.getElementById("con").getElementsByTagName("div");
for(i=0;i<4;i++)i==value?d[i].style.display="block":d[i].style.display="none";
}
}
function clearAuto(){clearInterval(autoStart)}
function setAuto(){autoStart=setInterval("auto(n)", 3000)}
function auto(){
n++;
if(n>3)n=0;
Mea(n);
}
function sub(){
n--;
if(n<0)n=3;
Mea(n);
}
setAuto();
function foucs_pause()
{
if(autoStart){clearAuto();autoStart=0;}
else{}
}
function foucs_start()
{
if(autoStart==0){setAuto();}
else{}
}
//-->
</SCRIPT>
希望这两个标签对你们都有用!
原文地址:http://bbs.powereasy.net/dispbbs.asp?boardid=67&id=366638