搜索:
首页 >> 下载中心 >> JavaScript源码 >> 迅雷首页新闻图片轮播效果js源码

迅雷首页新闻图片轮播效果js源码

2009-2-20 作者:天空诚 来源:中国Asp之家 投递文章

这个迅雷首页的图片轮播JavaScript源码是我辛辛苦苦从迅雷官方网站上独立出来的。

很不错的新闻图片轮播效果,既有主标题也有显示副标题

在连连看游戏网(llkyx.com)也使用了这个代码做小游戏推荐的展示

在线演示:http://www.aspxhome.com/adcode/114/

源代码打包下载:http://www.aspxhome.com/adcode/114/114.rar  (大小:149KB)

效果图如下:

部分JavaScript代码如下:

<script type="text/javascript">

function switchPic(screen) {
 if (screen > MaxScreen) {
  screen = 1 ;
 }
 
 for (i=1;i<=MaxScreen;i++) {
  document.getElementById("Switch_"+i).style.display = "none" ;
 }
 document.getElementById("Switch_"+screen).style.display = "block" ;  
 showSwitchNav(screen);
 showSwitchTitle(screen); 
 CurScreen = screen  ;
}
function showSwitchNav(screen) {
 var NavStr = "" ;
 for (i=1;i<=MaxScreen;i++) {
  if (i == screen) {
   NavStr += '<li onmouseover="pauseSwitch();" onmouseout="goonSwitch();"><a href="javascript:" target="_self" class="sel">'+i+'</a></li>' ;
  }
  else {
   NavStr += '<li onmouseover="pauseSwitch();" onmouseout="goonSwitch();" onclick="goManSwitch('+i+');"><a href="javascript:" target="_self">'+i+'</a></li>' ;
  }
  
 }
 document.getElementById("SwitchNav").innerHTML = NavStr ;
}
function showSwitchTitle(screen) {
 var titlestr = "" ;
 titlestr = '<h3><a href="'+Switcher[screen]['link']+'" target="_blank">'+Switcher[screen]['title']+'</a></h3><p><a href="'+Switcher[screen]['link']+'" target="_blank">'+Switcher[screen]['stitle']+'</a></p>' ;
 document.getElementById("SwitchTitle").innerHTML = titlestr ;
}
function reSwitchPic() {
 refreshSwitchTimer = null;
 switchPic(CurScreen+1);
 refreshSwitchTimer = setTimeout('reSwitchPic();', 3000);
}
function pauseSwitch() {
 clearTimeout(refreshSwitchTimer);
}
function goonSwitch() {
 clearTimeout(refreshSwitchTimer);
 refreshSwitchTimer = setTimeout('reSwitchPic();', 3000);
}
function goManSwitch(index) {
 clearTimeout(refreshSwitchTimer);
 
 CurScreen = index - 1 ;
 reSwitchPic();
}


  var CurScreen = 1 ;
  var MaxScreen = 7 ;
  var Switcher = new Array();
Switcher[1] = Array() ;
Switcher[1]['title'] = "李嘉欣坦言最爱许晋亨" ;
Switcher[1]['stitle'] = "活动走秀牵手男模目不斜视" ;
Switcher[1]['link'] = http://www.aspxhome.com/adcode/ ;
Switcher[2] = Array() ;
Switcher[2]['title'] = "周迅浓妆艳抹亮相" ;
Switcher[2]['stitle'] = "倾情演绎浪漫巴黎情致" ;
Switcher[2]['link'] = http://www.llkyx.com/ ;  var refreshSwitchTimer = null;
  switchPic(CurScreen);
  refreshSwitchTimer = setTimeout('reSwitchPic();', 3000);
  
  </script>

 

相关文章
手机版 JavaScript源码 Asp之家 Aspxhome.com
闽ICP备06017341号