bannerUrl =null;var tda = new Date().getTime(); var floatDiv = [ ,'' ,'
' ,' ' ,'
' ,'
' ,'
' ,'
' ,'
    ' , '
  1. ' , '
  2. ' , '
  3. ' , '
  4. ' , '
  5. ' , '
  6. ' , '
  7. ' , '
  8. ' /*, '
  9. '*/ , '
  10. ' , '
  11. ' , '
  12. ' , '
  13. ' , '
  14. ' , '
  15. ' , '
  16. ' , '
' ,'
' ,' ' ,'
' ,'
' ,'
' // '' // , '' ] var GdDivInsert = document.createElement('div'); GdDivInsert.innerHTML = floatDiv.join(''); document.getElementById('bannerId').appendChild(GdDivInsert); var banInt = setInterval(function(){ var imgH = document.querySelectorAll('#banner ul li img')[0].height; if(imgH!=0){ document.querySelector('#banner').style.height=(imgH*1.0+95)+'px'; clearInterval(banInt); } },800); (function () { if (!Function.prototype.bind) { Function.prototype.bind = function (obj) { var owner = this , args = Array.prototype.slice.call(arguments) , callobj = Array.prototype.shift.call(args); return function (e) { e = e || top.window.event || window.event; owner.apply(callobj, args.concat([e])); }; }; } })(); /* var banner_tabs = function (id) { this.ctn = document.getElementById(id); this.adLis = null; this.btns = null; this.animStep = 0.2; //动画速度0.1~0.9 this.switchSpeed = 6; //自动播放间隔(s) this.defOpacity = 1; this.tmpOpacity = 1; this.crtIndex = 0; this.crtLi = null; this.adLength = 0; this.timerAnim = null; this.timerSwitch = null; this.init(); }; */ (function(doc){ var oParent=doc.getElementById('banner'); var oCut=oParent.getElementsByTagName('ul')[0]; var aCut=oCut.getElementsByTagName('li'); var oBtn=oParent.getElementsByTagName('ol')[0]; var aBtn=oBtn.getElementsByTagName('li'); var iLen=aCut.length; var iW=aBtn[0].offsetWidth; var allW=oBtn.parentNode.offsetWidth; var clientNum=Math.ceil(allW/iW); var now=0; var timer=null; var autoInterval=5000; var oPrev=oParent.getElementsByTagName('span')[0]; var oNext=oParent.getElementsByTagName('span')[1]; for(var i=0;iclientNum){ if(now>=iLen){ oBtn.style.left=-iW*(iLen-clientNum)+'px'; }else if(now>=clientNum-1){ oBtn.style.left=-iW*(now-(clientNum-1)+1)+'px'; }else{ oBtn.style.left=0; } } } oPrev.onclick=function(){ now--; if(now<0){ now=iLen-1; } tab(); }; function next(){ now++; now%=iLen; tab(); } oNext.onclick=next; function preventSelect(){ return false; } oNext.onselectstart=oPrev.onselectstart=preventSelect; function autoPlay(){ timer=setInterval(next,autoInterval); } autoPlay(); function stopAutoPlay(){ clearInterval(timer); } oParent.onmouseover=stopAutoPlay; oParent.onmouseout=autoPlay; })(document); /* banner_tabs.prototype = { fnAnim: function (toIndex) { if (this.timerAnim) { window.clearTimeout(this.timerAnim); } if (this.tmpOpacity <= 0) { this.crtLi.style.opacity = this.tmpOpacity = this.defOpacity; this.crtLi.style.filter = 'Alpha(Opacity=' + this.defOpacity * 100 + ')'; this.crtLi.style.zIndex = 0; this.crtIndex = toIndex; return; } this.crtLi.style.opacity = this.tmpOpacity = this.tmpOpacity - this.animStep; this.crtLi.style.filter = 'Alpha(Opacity=' + this.tmpOpacity * 100 + ')'; this.timerAnim = window.setTimeout(this.fnAnim.bind(this, toIndex), 50); } , fnNextIndex: function () { return (this.crtIndex >= this.adLength - 1) ? 0 : this.crtIndex + 1; } , fnSwitch: function (toIndex) { if (this.crtIndex == toIndex) { return; } this.crtLi = this.adLis[this.crtIndex]; for (var i = 0; i < this.adLength; i++) { this.adLis[i].style.zIndex = 0; } this.crtLi.style.zIndex = 2; this.adLis[toIndex].style.zIndex = 1; for (var i = 0; i < this.adLength; i++) { this.btns[i].className = ''; } this.btns[toIndex].className = 'cur' this.fnAnim(toIndex); } , fnAutoPlay: function () { this.fnSwitch(this.fnNextIndex()); } , fnPlay: function () { this.timerSwitch = window.setInterval(this.fnAutoPlay.bind(this), this.switchSpeed * 1000); } , fnStopPlay: function () { window.clearTimeout(this.timerSwitch); } , init: function () { this.adLis = this.ctn.getElementsByTagName('li'); this.btns = this.ctn.getElementsByTagName('cite')[0].getElementsByTagName('span'); this.adLength = this.adLis.length; for (var i = 0, l = this.btns.length; i < l; i++) { with({ i: i }) { this.btns[i].index = i; this.btns[i].onclick = this.fnSwitch.bind(this, i); } } this.adLis[this.crtIndex].style.zIndex = 2; this.fnPlay(); this.ctn.onmouseover = this.fnStopPlay.bind(this); this.ctn.onmouseout = this.fnPlay.bind(this); } }; */ //var player1 = new banner_tabs('banner_tabs'); /* $(document).ready(function() { $('#jsCarousel').jsCarousel({ onthumbnailclick: function(src) { $("#overlay_pic").attr('src', src); $(".overlay").show(); }, autoscroll: true }); $(".overlay").click(function(){ $(this).hide(); }); }); */