JTBC(CMS)

开源与免费的跨平台网站内容管理系统解决方案

腾讯交流群: 2254994
技术支持群: 27032719
首页 » 在线论坛 » .NET版本 
帖子内容
1 楼
gxjdemy
铜牌会员
积分 268
注册 2010-03-01
     
js图片调用效果 那里不对呢!?
js 文件
function ImgMovie(){
  this.Img=new Array();
  this.Title=new Array();
  this.Summary=new Array();
  this.ImgPrv=new Array();
  this.Link=new Array();
  this.LinkType=new Array();
  this.movCount=0;
  this.curImg=0;
  this.Target="_self";
  this.TargetExt="";
 
  this.ImgBox=null;
  this.TitleBox=null; 
  this.SummaryBox=null;
  this.Style=0; //0透明过渡,1随机切换
 
  this.AddMov=addMov;
  this.OpenUrl=openUrl;
  this.Play=nextMov;
  this.PlayStyle=playStyle;
  this.SetStyle=setStyle;
  this.ExecEvent=execEvent;
}
function execEvent(){
  if(this.Link[this.curImg]!=""){
    eval(this.Link[this.curImg]);
  }
}
function addMov(imgurl,tit,msg,linkurl,linkType){ 
  this.Img[this.movCount]="";
  this.Title[this.movCount]=""; 
  this.Summary[this.movCount]="";
  this.Link[this.movCount]="";
  this.LinkType[this.movCount]="URL";
 
  if(imgurl){
this.Img[this.movCount]=imgurl;
    this.ImgPrv[this.movCount]=new Image();
    this.ImgPrv[this.movCount].src=imgurl;
  }
  if(tit)this.Title[this.movCount]=tit; 
  if(msg)this.Summary[this.movCount]=msg;
  if(linkurl)this.Link[this.movCount]=linkurl;
  if(linkType)this.LinkType[this.movCount]=linkType;
  this.movCount++;
}
 
function setStyle(){
  if (this.ImgBox!=null){
  switch (this.Style){
case 0:
  eval(this.ImgBox+".filters.blendTrans.apply()");
  break;
case 1:
  eval(this.ImgBox+".filters.revealTrans.Transition=Math.floor(Math.random()*20)");
  eval(this.ImgBox+".filters.revealTrans.apply()");
  break;
default:
  eval(this.ImgBox+".filters.blendTrans.apply()");
  break;
  }
  }
}
function playStyle(){
  if (this.ImgBox!=null){
  switch (this.Style){
case 0:
          eval(this.ImgBox+".filters.blendTrans.play()");
  break;
case 1:
          eval(this.ImgBox+".filters.revealTrans.play()");
  break;
default:
          eval(this.ImgBox+".filters.blendTrans.play()");
  break;
  }
  }
}
function nextMov(){
  if(this.curImg<this.movCount-1)this.curImg++ ;
  else this.curImg=0;
  this.SetStyle();
  if(this.ImgBox!=null)document.images[this.ImgBox].src=this.Img[this.curImg];
  if(this.TitleBox!=null)eval(this.TitleBox+".innerText=this.Title["+this.curImg+"]");
  if (this.SummaryBox!=null)eval(this.SummaryBox+".innerText=this.Summary["+this.curImg+"]");
  this.PlayStyle();
}
function openUrl(){
  var jumpUrl=this.Link[this.curImg];
  if(this.Target=='')this.Target='_self';
  if (jumpUrl=='') return false;
 
  if (this.LinkType[this.curImg]=="EVENT"){
  this.ExecEvent();
  }else{
    if(this.TargetExt!=''){
      window.open(jumpUrl,this.Target,this.TargetExt);
}else{
      window.open(jumpUrl,this.Target);
}
  }
}
function PlayImgMov(mov,timeout){
eval(mov+".Play()");
eval("Timer_"+mov+"=window.setTimeout(\"PlayImgMov('"+mov+"','"+timeout+"')\","+timeout+")");
}



调用节点:

{$}{$$}<SCRIPT>
ImgNews.AddMov('/
article/{$=split("{$content_images_list}", "|")(0)}','{$topic}','','{$=curl("{$baseurl}", iurl('detail', {$id}, {$urltype}, 'folder={$createfolder};filetype={$createfiletype};time={$time}'))}');
</SCRIPT> {$$}{$}






调用代码:


<table width="224" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="224" valign="top" background="">
      <script src="{$global.images}js/ImgMovie.js"></script><!--修改好了JS文件路径 -->
      <script>
        var ImgNews=new ImgMovie;
        ImgNews.Target="_blank";
      </script>
      {$=itransfer('top', 'imgtext', 'topx=5;tnum=40;genre=article;class=5;osql= and jtb_acontent_images_list <> """"')}<!--修改好了CLASS类,这里的sql语句不知有没有出错 -->

            <table width="224" border="0" cellspacing="0" cellpadding="0" height="179">
              <tr>
                <td height="150" align="center"> <table border="0" cellpadding="0" cellspacing="7">
                    <tr>
                      <td width="175" height="120" align="center" valign="middle"><a href="javascript:ImgNews.OpenUrl();"><img name="newsImgBox" id="newsImgBox" src="" width="175" height="120" border="0"style="FILTER: revealTrans(duration=2,transition=20);"></a></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td height="20" align="center">
  <a href="javascript:ImgNews.OpenUrl();" class="a01"><span id="newsTitleBox">标题</span></a>
</td>
              </tr>
              <tr>
                <td height="9" align="center"></td>
              </tr>
</table> 

      <script>
        ImgNews.ImgBox="newsImgBox";
        ImgNews.TitleBox="newsTitleBox";
        ImgNews.Style=1;
        PlayImgMov("ImgNews",5000);
      </script>
           
    </td>
  </tr>
</table>







本帖由 gxjdemy 于 2010-04-06 10:39:02 编辑过
2010-04-06 10:34:30 越来越有味道的jtbc
2 楼
jetiben
管理员
积分 7330
注册 2006-06-28
     
回复: js图片调用效果 那里不对呢!?
你如果使用的是 ASP.NET 版本的话,代码完全是错的。如果是ASP版本 osql 的语句有错,应该是 osql= and a_content_images_list <> ##
2010-04-06 10:38:04
3 楼
gxjdemy
铜牌会员
积分 268
注册 2010-03-01
     
回复: js图片调用效果 那里不对呢!?
代码完全是错的!?调用节点错了吗?
2010-04-06 10:42:11 越来越有味道的jtbc