Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[素材] qq客服上用的图片焦点js+css

[复制链接]
briskvoice 发表于 2011-9-30 00:00:09 | 显示全部楼层 |阅读模式
本帖最后由 briskvoice 于 2011-9-30 00:03 编辑



使用方法:
1.把附件包的图片上传到www/image/
2.在需要的页面添加diy(静态模块),添加如下代码
  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. <title>QQ995505479</title>
  6. <style type="text/css">
  7. body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td,iframe {margin:0;padding:0;}
  8. fieldset,img {border:0;}
  9. address,caption,cite,dfn,em,th,var {font-style:normal;font-weight:normal;}
  10. ol,ul {list-style:none;}
  11. caption,th {text-align:left;}
  12. h1,h2,h3,h4,h5,h6 {font-size:100%;font-weight:normal;}
  13. q:before,q:after {content:'';}
  14. abbr,acronym {border:0;}

  15. .on,.question,.often,.question_q a{
  16.         background:url(image/index_bg.png) no-repeat;
  17. }
  18. .left{
  19.         float:left;
  20.         width:670px;
  21. }

  22. .banner{
  23.         width:670px;
  24.         height:240px;
  25.         margin-top:5px;
  26.         position:relative;
  27. }
  28. .banner_tab{
  29.         height:43px;
  30.         position:absolute;
  31.         right: 5px;
  32.         bottom: 5px;
  33. }
  34. .banner_tab ul {
  35.         cursor:pointer;
  36. }
  37. .banner_tab li {
  38.     float: left;
  39.     list-style-type: none;
  40.     text-align: center;
  41. }
  42. .banner_tab a {
  43.          width:80px;
  44.          height:43px;
  45.          display:block;
  46.          margin-right:2px;
  47. }
  48. .banner_tab  img{
  49.         border:1px solid #659ab6;
  50. }
  51. .hidecontent {display:none;}
  52. .on{
  53.          background-position:0px -100px;
  54. }
  55. .on img{
  56.       border:1px solid #0099ff;
  57. }
  58. .out{}

  59. .clear{ clear:both;}

  60. .content{
  61.         margin:0 auto;
  62.         background:url(image/content_bg.png) repeat-x top;
  63.         border-left:1px solid #bad1de;
  64.         border-right:1px solid #bad1de;
  65. }

  66. .tab_img{
  67.          width:72px;
  68.          height:35px;
  69.          margin-top:3px;
  70.          border:1px solid #fff;
  71. }

  72. .help{
  73.         margin-top:10px;
  74.         width:670px;
  75. }
  76. .help .div_p{
  77.         padding:10px 5px 15px;
  78.         >padding:13px 5px 15px;
  79. }
  80. .help .help_ul{
  81.         padding:10px 0px 30px 30px;
  82.         >padding-top:1px;
  83. }

  84. .help_ul li{
  85.         float:left;
  86.         width:310px;
  87.         height:28px;
  88.         line-height:28px;
  89.         position:relative;
  90. }
  91. .help_ul .img_hot{
  92.         top:8px;
  93.         position:absolute;
  94. }

  95. a.k:link, a.k:visited {
  96.         color:#228ada;
  97.         text-decoration:none;
  98. }
  99. a.k:active,a.k:hover {
  100.         color:#000;
  101.         text-decoration:underline;
  102. }
  103. .right{
  104.         width:230px;
  105.         float:right;
  106. }




  107. </style>
  108. <script type="text/javascript">
  109. function setTab(/*string*/name,/*int*/ itemCnt,/*int*/ curItem, /**/classHide, /**/classShow)
  110. {
  111.          for(i=1;i<=itemCnt;i++)
  112.         {
  113.                 eval("document.getElementById('tab_" + name + "_" + i + "').className='" + classHide + "'");
  114.         }
  115.         eval("document.getElementById('tab_" + name + "_" + curItem + "').className='" + classShow + "'");

  116. for(i=1;i<=itemCnt;i++)
  117. {
  118.   eval("ele_hide = document.getElementById('con_" + name + "_" + i +"')");
  119.   if(ele_hide) ele_hide.style.display = "none";
  120. }
  121. eval("ele_play = document.getElementById('con_" + name + "_" + curItem + "')");
  122. if(ele_play) ele_play.style.display = "block";
  123. }
  124. </script>

  125. </head>

  126. <body>
  127. <div class="banner" id="banner">
  128.                         <div class="banner_tab clearfix">
  129.                                 <ul>
  130.                                   <li id="tab_tophome_1" class="on"><a href="/other/phone_flow.shtml" target="_blank"  onmousemove="startIndex=1;setTab('tophome',4,1,'out','on');" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.PHONE_2'});"><img src="image/ad_1.jpg"  class="tab_img" alt="电话按键指引"/></a></li>
  131.                                   <li id="tab_tophome_2" class="out"><a href="/self/self_help.shtml" target="_blank" onmousemove="startIndex=2;setTab('tophome',4,2,'out','on');" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SELF_2'});"><img src="image/ad_3.jpg"  class="tab_img" alt="自助服务"/></a></li>
  132.                                   <li id="tab_tophome_3" class="out"><a href="showSurvey?survey_id=567" target="_blank" onmousemove="startIndex=3;setTab('tophome',4,3,'out','on');" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.STUDY_2'});"><img src="image/ad_2.jpg"  class="tab_img" alt="腾讯学堂"/></a></li>
  133.                                   <li id="tab_tophome_4" class="out"><a href="c1090519040.htm" target="_blank" onmousemove="startIndex=4;setTab('tophome',4,4,'out','on');" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SOSO_2'});"><img src="ad_4.jpg"  class="image/tab_img" alt="问问专区"/></a></li>
  134.                                 </ul>  
  135.                         </div>
  136.                         <div>
  137.                                 <div id="con_tophome_1"><a href="/other/phone_flow.shtml" target="_blank" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.PHONE_1'});"><img src="image/ad_1.jpg" alt="电话按键指引"/></a></div>   
  138.                                 <div id="con_tophome_2"  class="hidecontent"><a href="/self/self_help.shtml" target="_blank" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SELF_1'});"><img src="image/ad_3.jpg" alt="自助服务" /></a></div>   
  139.                                 <div id="con_tophome_3"  class="hidecontent"><a href="showSurvey?survey_id=567" target="_blank" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.STUDY_1'});"><img src="image/ad_2.jpg" alt="腾讯学堂" /></a></div>   
  140.                                 <div id="con_tophome_4"  class="hidecontent"><a href="c1090519040.htm" target="_blank" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SOSO_1'});"><img src="image/ad_4.jpg" alt="问问专区"/></a></div>     
  141.                           <div class="clear"></div>
  142.                         </div>
  143.         </div>
  144.                 <script type="text/javascript">
  145. var pause = false;
  146. var con_num = 4;
  147. var startIndex = 1;
  148. function setLoop(){
  149.   try{
  150.    var oScroll = document.getElementById('banner');
  151.    oScroll.noWrap = true;
  152.    oScroll.onmouseover = function(e){pause = true;};
  153.    oScroll.onmouseout = function(e){pause = false;};
  154.    setInterval('scrollTopHome()', 3000);
  155.    }catch(e){alert(e.toString());}
  156. }
  157. function scrollTopHome(){
  158.   if(pause) return;
  159.   startIndex += 1;
  160.   if(startIndex > con_num){startIndex = 1;}
  161.   setTab('tophome',4,startIndex,'out','on');
  162. }
  163. setLoop();
  164. </script>
  165. </body>
  166. </html>
复制代码

OK完工



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
七酱 发表于 2011-9-30 00:01:56 | 显示全部楼层
围观不解释
回复

使用道具 举报

anluan 发表于 2011-9-30 02:02:37 | 显示全部楼层
同样二楼
回复

使用道具 举报

wyq8848 发表于 2011-9-30 07:11:48 | 显示全部楼层
挺!不知道是什么效果,马上试一试
回复

使用道具 举报

jxhjjm 发表于 2011-9-30 07:20:38 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

ilei365 发表于 2011-9-30 07:26:18 | 显示全部楼层
很不错。。。。。。。
回复

使用道具 举报

eisdl 发表于 2011-9-30 09:59:26 | 显示全部楼层
本帖最后由 eisdl 于 2011-9-30 10:00 编辑

楼主  有问题   图片路径错误  没有前面的image
  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. <title>QQ995505479</title>
  6. <style type="text/css">
  7. body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td,iframe {margin:0;padding:0;}
  8. fieldset,img {border:0;}
  9. address,caption,cite,dfn,em,th,var {font-style:normal;font-weight:normal;}
  10. ol,ul {list-style:none;}
  11. caption,th {text-align:left;}
  12. h1,h2,h3,h4,h5,h6 {font-size:100%;font-weight:normal;}
  13. q:before,q:after {content:'';}
  14. abbr,acronym {border:0;}

  15. .on,.question,.often,.question_q a{
  16. background:url(index_bg.png) no-repeat;
  17. }
  18. .left{
  19. float:left;
  20. width:670px;
  21. }

  22. .banner{
  23. width:670px;
  24. height:240px;
  25. margin-top:5px;
  26. position:relative;
  27. }
  28. .banner_tab{
  29. height:43px;
  30. position:absolute;
  31. right: 5px;
  32. bottom: 5px;
  33. }
  34. .banner_tab ul {
  35. cursor:pointer;
  36. }
  37. .banner_tab li {
  38. float: left;
  39. list-style-type: none;
  40. text-align: center;
  41. }
  42. .banner_tab a {
  43. width:80px;
  44. height:43px;
  45. display:block;
  46. margin-right:2px;
  47. }
  48. .banner_tab img{
  49. border:1px solid #659ab6;
  50. }
  51. .hidecontent {display:none;}
  52. .on{
  53. background-position:0px -100px;
  54. }
  55. .on img{
  56. border:1px solid #0099ff;
  57. }
  58. .out{}

  59. .clear{ clear:both;}

  60. .content{
  61. margin:0 auto;
  62. background:url(content_bg.png) repeat-x top;
  63. border-left:1px solid #bad1de;
  64. border-right:1px solid #bad1de;
  65. }

  66. .tab_img{
  67. width:72px;
  68. height:35px;
  69. margin-top:3px;
  70. border:1px solid #fff;
  71. }

  72. .help{
  73. margin-top:10px;
  74. width:670px;
  75. }
  76. .help .div_p{
  77. padding:10px 5px 15px;
  78. >padding:13px 5px 15px;
  79. }
  80. .help .help_ul{
  81. padding:10px 0px 30px 30px;
  82. >padding-top:1px;
  83. }

  84. .help_ul li{
  85. float:left;
  86. width:310px;
  87. height:28px;
  88. line-height:28px;
  89. position:relative;
  90. }
  91. .help_ul .img_hot{
  92. top:8px;
  93. position:absolute;
  94. }

  95. a.k:link, a.k:visited {
  96. color:#228ada;
  97. text-decoration:none;
  98. }
  99. a.k:active,a.k:hover {
  100. color:#000;
  101. text-decoration:underline;
  102. }
  103. .right{
  104. width:230px;
  105. float:right;
  106. }




  107. </style>
  108. <script type="text/javascript">
  109. function setTab(/*string*/name,/*int*/ itemCnt,/*int*/ curItem, /**/classHide, /**/classShow)
  110. {
  111. for(i=1;i<=itemCnt;i++)
  112. {
  113. eval("document.getElementById('tab_" + name + "_" + i + "').className='" + classHide + "'");
  114. }
  115. eval("document.getElementById('tab_" + name + "_" + curItem + "').className='" + classShow + "'");

  116. for(i=1;i<=itemCnt;i++)
  117. {
  118. eval("ele_hide = document.getElementById('con_" + name + "_" + i +"')");
  119. if(ele_hide) ele_hide.style.display = "none";
  120. }
  121. eval("ele_play = document.getElementById('con_" + name + "_" + curItem + "')");
  122. if(ele_play) ele_play.style.display = "block";
  123. }
  124. </script>

  125. </head>

  126. <body>
  127. <div class="banner" id="banner">
  128. <div class="banner_tab clearfix">
  129. <ul>
  130. <li id="tab_tophome_1" class="on"><a href="/other/phone_flow.shtml" target="_blank" onmousemove="startIndex=1;setTab('tophome',4,1,'out','on');" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.PHONE_2'});"><img src="ad_1.jpg" class="tab_img" alt="电话按键指引"/></a></li>
  131. <li id="tab_tophome_2" class="out"><a href="/self/self_help.shtml" target="_blank" onmousemove="startIndex=2;setTab('tophome',4,2,'out','on');" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SELF_2'});"><img src="ad_3.jpg" class="tab_img" alt="自助服务"/></a></li>
  132. <li id="tab_tophome_3" class="out"><a href="showSurvey?survey_id=567" target="_blank" onmousemove="startIndex=3;setTab('tophome',4,3,'out','on');" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.STUDY_2'});"><img src="ad_2.jpg" class="tab_img" alt="腾讯学堂"/></a></li>
  133. <li id="tab_tophome_4" class="out"><a href="c1090519040.htm" target="_blank" onmousemove="startIndex=4;setTab('tophome',4,4,'out','on');" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SOSO_2'});"><img src="ad_4.jpg" class="tab_img" alt="问问专区"/></a></li>
  134. </ul>
  135. </div>
  136. <div>
  137. <div id="con_tophome_1"><a href="/other/phone_flow.shtml" target="_blank" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.PHONE_1'});"><img src="ad_1.jpg" alt="电话按键指引"/></a></div>
  138. <div id="con_tophome_2" class="hidecontent"><a href="/self/self_help.shtml" target="_blank" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SELF_1'});"><img src="ad_3.jpg" alt="自助服务" /></a></div>
  139. <div id="con_tophome_3" class="hidecontent"><a href="showSurvey?survey_id=567" target="_blank" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.STUDY_1'});"><img src="ad_2.jpg" alt="腾讯学堂" /></a></div>
  140. <div id="con_tophome_4" class="hidecontent"><a href="c1090519040.htm" target="_blank" onclick="javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SOSO_1'});"><img src="ad_4.jpg" alt="问问专区"/></a></div>
  141. <div class="clear"></div>
  142. </div>
  143. </div>
  144. <script type="text/javascript">
  145. var pause = false;
  146. var con_num = 4;
  147. var startIndex = 1;
  148. function setLoop(){
  149. try{
  150. var oScroll = document.getElementById('banner');
  151. oScroll.noWrap = true;
  152. oScroll.onmouseover = function(e){pause = true;};
  153. oScroll.onmouseout = function(e){pause = false;};
  154. setInterval('scrollTopHome()', 3000);
  155. }catch(e){alert(e.toString());}
  156. }
  157. function scrollTopHome(){
  158. if(pause) return;
  159. startIndex += 1;
  160. if(startIndex > con_num){startIndex = 1;}
  161. setTab('tophome',4,startIndex,'out','on');
  162. }
  163. setLoop();
  164. </script>
  165. </body>
  166. </html>
复制代码

回复

使用道具 举报

非一般感觉 发表于 2011-9-30 11:00:55 | 显示全部楼层
   不错  先看看了啊
回复

使用道具 举报

Iisluo.com 发表于 2011-9-30 11:33:58 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

wsyp 发表于 2011-9-30 11:47:09 | 显示全部楼层
这个不错。学习收集了!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-18 06:22 , Processed in 0.030064 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表