JavaScript ASP VB PHP .NET HTML
返回首页
当前位置: 主页 > 技术资料 > 编程文档 > JavaScript >

淘宝幻灯片特效

时间:2009-09-04 09:42来源:MingchenNet.com 作者:明晨网络原创 点击:
很经典的淘宝幻灯片特效,使用JavaScript而非Flash实现图片轮播,简单灵活通用。此处举例简要说明使用方法,文末提供打包下载。 !DOCTYPEhtmlPUBLIC-//W3C//DTDXHTML1.0Transitional//ENhttp://www.w3.org/TR/xhtml

    很经典的淘宝幻灯片特效,使用JavaScript而非Flash实现图片轮播,简单灵活通用。明晨网络Mingchennet.com在此处举例简要说明使用方法,文末提供打包下载。此代码使用了yahoo的js框架yui,比较臃肿,jquery应该也有实现这种特效的类的,有机会再找吧。

 

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  2. <html xmlns="http://www.w3.org/1999/xhtml"> 
  3. <head> 
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
  5.  
  6. <title>无标题文档</title> 
  7. <style type="text/css"> 
  8. <!--  
  9. /*指定幻灯片层外部容器宽度为120px*/  
  10. #MainPromotionBanner{ width:120px;}  
  11. #SlidePlayer{position:relative;margin:0 auto;}  
  12. #SlidePlayer .Slides{  
  13.     padding:0;  
  14.     margin:0;  
  15.     list-style:none;  
  16.     /*指定幻灯片层的高度为50px*/  
  17.     height:50px;  
  18.     overflow:hidden;  
  19. }  
  20.  
  21. /*指定幻灯片层中图片的宽度为120px,高度为50px*/  
  22. #SlidePlayer .Slides li {float:left;width:120px;height:50px;}  
  23. #SlidePlayer .Slides img{display:block;width:120px;height:50px;border:0;}  
  24. #SlidePlayer .SlideTriggers{  
  25.     position:absolute;  
  26.     bottom:0;     
  27.     right:0;  
  28.     z-index:10;  
  29.     margin:0;  
  30.     padding:0;  
  31.     list-style:none;  
  32.     height:25px;  
  33. }  
  34. #SlidePlayer .SlideTriggers li{  
  35.     float:left;  
  36.     display:inline;  
  37.     margin:3px;  
  38.     width:16px;  
  39.     height:16px;  
  40.     color:#74a8ed;  
  41.     text-align:center;  
  42.     line-height:16px;  
  43.     font-family:Arial;  
  44.     font-size:.9em;  
  45.     overflow:hidden;  
  46.     cursor:pointer;  
  47.     background:url(slide_trigger.gif) no-repeat center center;  
  48. }  
  49. #SlidePlayer .SlideTriggers li.Current{  
  50.     margin:0 3px;  
  51.     height:21px;  
  52.     width:21px;  
  53.     border:0;  
  54.     color:#fff;  
  55.     font-size:1.4em;  
  56.     font-weight:bold;  
  57.     line-height:21px;  
  58.     background:url(slide_trigger_c.gif) no-repeat center center;  
  59. }  
  60. --> 
  61. </style> 
  62. </head> 
  63.  
  64. <body> 
  65.  
  66.  
  67. <div id="MainPromotionBanner"> 
  68. <div id="SlidePlayer"> 
  69.   <ul class="Slides"> 
  70.     <li><a target="_blank" href="http://www.mingchennet.com"><img src="http://www.mingchennet.com/templets/images/top-logo.gif" /></a></li> 
  71.     <li><a target="_blank" href="http://www.qdseek.com"><img src="http://qdseek.com/images/qdseek_com_ico.gif" /></a></li> 
  72.     <li><a target="_blank" href="http://www.baidu.com"><img src="http://www.baidu.com/img/logo-yy.gif" /></a></li> 
  73.     <li><a target="_blank" href="http://g.cn"><img src="http://www.google.cn/intl/zh-CN/images/logo_cn.gif" /></a></li> 
  74.   </ul> 
  75. </div> 
  76. <script type="text/javascript" src="yui.js"></script> 
  77. <script type="text/javascript" src="tb_slide.js"></script> 
  78. <script type="text/javascript">         TB.widget.SimpleSlide.decoration('SlidePlayer', {eventType:'mouse', effect:'scroll'});  
  79. </script> 
  80. </div> 
  81.  
  82.  
  83. </body> 
  84. </html> 

 

淘宝幻灯片特效演示代码

(责任编辑:admin)
顶一下
(1)
100%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码:点击我更换图片
推荐内容