PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > JS特效 > 图片特效 > 正文

    带投影效果的3D图片滚动js特效代码

    作者:w634381967来源:网络浏览:时间:2014-06-21 09:16:41我要评论
    分享到

    内容介绍

    仿腾讯大秦网带淡淡投影效果,可以设置描述和链接地址的js立体图片滚动代码。

    核心js代码如下:


     
    复制代码 代码如下:
    <script type="text/javascript">
    (function ()
    {
    var arrImagePaths=[];
    var oSlidePlay=document.getElementById('slide_play');
    var oImgViewer=null;
    var aLiBtn=oSlidePlay.getElementsByTagName('ol')[0].getElementsByTagName('li');
    var miaovWorkNowIndex=0;
    var iDirect=1;

    var oAutoPlayTimer=null;

    for(i=0;i<aLiBtn.length;i++)
    {
      arrImagePaths[i]={};
     
      aLiBtn[i].index=i;
      aLiBtn[i].onmouseover=function ()
      {
       gotoImg(this.index);
      };
    }

    //注意:
    //************** 用于修改文字和图片的位置 **************

    //用于修改图片地址
    arrImagePaths[0].src="images/1.jpg";
    arrImagePaths[1].src="images/2.jpg";
    arrImagePaths[2].src="images/3.jpg";
    arrImagePaths[3].src="images/4.jpg";
    arrImagePaths[4].src="images/5.jpg";

    //用于修改图片下方的文字
    arrImagePaths[0].info='模板网-场馆介绍1-b5.mxunkeji.com';
    arrImagePaths[1].info='模板网-场馆介绍2-b5.mxunkeji.com';
    arrImagePaths[2].info='模板网-场馆介绍3-b5.mxunkeji.com';
    arrImagePaths[3].info='模板网-场馆介绍4-b5.mxunkeji.com';
    arrImagePaths[4].info='模板网-场馆介绍5-b5.mxunkeji.com';

    //用于修改文字的链接地址
    arrImagePaths[0].href='https://b5.mxunkeji.com';
    arrImagePaths[1].href='https://b5.mxunkeji.com';
    arrImagePaths[2].href='https://b5.mxunkeji.com';
    arrImagePaths[3].href='https://b5.mxunkeji.com';
    arrImagePaths[4].href='https://b5.mxunkeji.com';

    //修改链接跳转地址的target(_blank、_self等)
    arrImagePaths.link_target='_self';
    //**************** 结束用于修改的位置 *****************

    function startAutoPlay()
    {
      oAutoPlayTimer=setInterval
      (
       function ()
       {
        miaovWorkNowIndex+=iDirect;
       
        if(0==miaovWorkNowIndex)
        {
         iDirect=1;
        }
       
        if(miaovWorkNowIndex==aLiBtn.length-1)
        {
         iDirect=-1;
        }
       
        gotoImg(miaovWorkNowIndex);
       }, 4000
      );
    }

    startAutoPlay();

    function gotoImg(index)
    {
      for(i=0;i<aLiBtn.length;i++)
      {
       aLiBtn[i].className='';
      }
      aLiBtn[index].className='active';
      oImgViewer.gotoImg(index);
     
      miaovWorkNowIndex=index;
    }

    oImgViewer=new ImgViewer
    (
      arrImagePaths, oSlidePlay,
      function (index)
      {
       clearInterval(oAutoPlayTimer);
       startAutoPlay();
      
       for(i=0;i<aLiBtn.length;i++)
       {
        aLiBtn[i].className='';
       }
       aLiBtn[index].className='active';
       miaovWorkNowIndex=index;
      }
    );
    gotoImg(Math.floor(arrImagePaths.length/2));
    })();
    </script>




    下载资源:162 下载积分:0 积分
    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-55-296-1.html
    相关热词搜索: js特效代码 3D图片滚动