国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

jQuery實現(xiàn)企業(yè)網(wǎng)站橫幅焦點圖切換功能實例

2024-05-06 16:19:04
字體:
供稿:網(wǎng)友

這篇文章主要介紹了jQuery實現(xiàn)企業(yè)網(wǎng)站橫幅焦點圖切換功能,實例分析了jQuery企業(yè)網(wǎng)站焦點圖的詳細實現(xiàn)方法,非常簡單實用,需要的朋友可以參考下

本文實例講述了jQuery實現(xiàn)企業(yè)網(wǎng)站橫幅焦點圖切換功能的方法。分享給大家供大家參考。具體如下:

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  3. <html xmlns="http://www.w3.org/1999/xhtml"
  4. <head> 
  5. <title>jQuery淡出淡入帶縮略圖幻燈片</title> 
  6. <script type="text/javascript" src="jquery-1.6.2.min.js"></script> 
  7. <style> 
  8. .flashBanner{width:782px;height:326px; 
  9. overflow:hidden;margin:0 auto; 
  10. .flashBanner{position:relative;} 
  11. .flashBanner .mask{height:32px;line-height:32px; 
  12. background-color:#000;width:100%; 
  13. text-align:right;position:absolute;left:0; 
  14. bottom:-32px;filter:alpha(opacity=70); 
  15. -moz-opacity:0.7;opacity:0.7;overflow:hidden; 
  16. .flashBanner .mask img{ 
  17. vertical-align:middle; 
  18. margin-right:10px; 
  19. cursor:pointer; 
  20. .flashBanner .mask img.show{margin-bottom:3px;} 
  21. </style> 
  22. <script type="text/javascript"
  23. $(function(){ 
  24. $(".flashBanner").each(function(){ 
  25. var timer; 
  26. $(".flashBanner .mask img").click(function(){ 
  27. var index = $(".flashBanner .mask img").index($(this)); 
  28.  
  29. changeImg(index); 
  30. }).eq(0).click(); 
  31. $(this).find(".mask").animate({ 
  32. "bottom":"0" 
  33. },700); 
  34. $(".flashBanner").hover(function(){ 
  35. clearInterval(timer); 
  36.  
  37. },function(){ 
  38. timer = setInterval(function(){ 
  39. var show = $(".flashBanner .mask img.show").index(); 
  40. if (show >= $(".flashBanner .mask img").length-1) 
  41. show = 0; 
  42. else 
  43. show ++; 
  44. changeImg(show); 
  45. },3000); 
  46. }); 
  47. function changeImg (index) 
  48. $(".flashBanner .mask img").removeClass("show").eq(index).addClass("show"); 
  49. $(".flashBanner .bigImg").parents("a").attr("href",$(".flashBanner .mask img").eq(index).attr("link")); 
  50. $(".flashBanner .bigImg").hide().attr("src",$(".flashBanner .mask img").eq(index).attr("uri")).fadeIn("slow"); 
  51. timer = setInterval(function(){ 
  52. var show = $(".flashBanner .mask img.show").index(); 
  53. if (show >= $(".flashBanner .mask img").length-1) 
  54. show = 0; 
  55. else 
  56. show ++; 
  57. changeImg(show); 
  58. },3000); 
  59. }); 
  60. }); 
  61. </script> 
  62. </head> 
  63. <body> 
  64. <div class="flashBanner"
  65. <a href="/"><img class="bigImg" width="782" height="326" /></a> 
  66. <div class="mask"
  67. <img src="11.jpg" uri="11.jpg" link="/" width="60" height="22"/> 
  68. <img src="22.jpg" uri="22.jpg" link="/" width="60" height="22"/> 
  69. <img src="33.jpg" uri="33.jpg" link="/" width="60" height="22"/> 
  70. <img src="44.jpg" uri="44.jpg" link="/" width="60" height="22"/> 
  71. <img src="55.jpg" uri="55.jpg" link="/" width="60" height="22"/> 
  72. </div> 
  73. </div> 
  74. <div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';"
  75. </div> 
  76. </body> 
  77. </html> 

希望本文所述對大家的jQuery程序設(shè)計有所幫助。


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 赫章县| 建水县| 永昌县| 且末县| 宁远县| 大庆市| 长顺县| 竹溪县| 枣强县| 松江区| 凌海市| 盐山县| 禹州市| 滨州市| 新宾| 泰宁县| 丰城市| 衡东县| 南溪县| 漳州市| 乳源| 贞丰县| 万山特区| 滁州市| 邢台县| 齐河县| 怀集县| 微博| 洪泽县| 鱼台县| 察隅县| 科尔| 黄平县| 韶关市| 虞城县| 平潭县| 荔波县| 施秉县| 新竹县| 临清市| 三门县|