账号通
    

账号  

密码  

49742

查看

99

回复
主题:适合SEO的图片幻灯,亮点:JS+引擎蜘蛛可读 [收藏主题] 本贴被认定为精华 转到:  
q365 当前离线

130

主题

0

广播

1

粉丝
添加关注
级别:一年级

用户积分:639 分
登录次数:149 次
注册时间:2011/2/3
最后登录:2016/5/8
q365 发表于:2011/3/22 8:00:39   | 只看该作者 查看该作者主题 楼主 
科汛在线商城系统(NET)

一般的flash幻灯图片,是不会被搜索引擎读取的,有些JS幻灯 链接写在JS代码里面,这样也不会被蜘蛛引擎读取,我找了很久适合SEO的幻灯代码,前台是可见的代码,引擎蜘蛛会读取,现在修改成支持KC使用,现在分享给大家.原创代码,您的留言是我发帖的动力.

看看本站实例:博雅网上菜:

点击查看原图

模板部分分为 CSS DIV层布局 +JS调用

代码如下

  1. <!--首页幻灯 -->
  2. <div class="newflash">
  3. <ul class="flashimg" id="SlayerA_1">{LB_首页幻灯}</ul>
  4. <div class="flashBg">
  5. <ul class="an" id="SlayerA_2">
  6. <li class="flNa"><a href="javascript:;">1</a></li>
  7. <li class="flNa"><a href="javascript:;">2</a></li>
  8. <li class="flNa"><a href="javascript:;">3</a></li>
  9. <li class="flNa"><a href="javascript:;">4</a></li>
  10. <li class="flNa"><a href="javascript:;">5</a></li>
  11. </ul>{LB_网站公告}<!--网站滚动广告 -->
  12. </div></div>
  13. <SCRIPT type="text/javascript" language="JavaScript" src="/js/nx.js"></SCRIPT>
  14. <script>ddSliderPlayers('SlayerA_1','SlayerA_2',6,'current');</script>
  15. <!--幻灯CSS 根据自己需要修改CSS尺寸 -->
  16. <style type="text/css">
  17. .newflash{width:300px; height:255px;}
  18. .flashimg img{float:left;width:300px;height:255px;}
  19. .flashimg{float:left;width:300px;}
  20. .flashBg{width:300px; background-color: #A69784;}
  21. .an li{float:left;}
  22. .an li a{background:#fff;color:#333;overflow:hidden;padding:0 3px;-webkit-transition: all 0.2s ease-out;-o-transition: all 0.2s ease-out;}
  23. .an li.current a,.an li a:hover{background:#ff6600;color:#fff; text-decoration:none;}
  24. .an li a:hover{-webkit-transform: scale(1.4);-o-transform: scale(1.4);}
  25. .flNa{padding: 2px;}
  26. </style>
  27. <!--首页幻灯结束 -->



JS调用部分:保存成NX.JS放到上面模板路径正确

  1. function ddSliderPlayers(elementId,handleId, pauseTime, currentClassName) {

  2. try {
  3.   if (typeof ddSliderPlayer == 'undefined')
  4.    ddSliderPlayer = {};
  5. } catch (e) {
  6.   ddSliderPlayer = {};
  7. }
  8. var elementObj = document.getElementById(elementId);
  9. var handler = document.getElementById(handleId);
  10. ddSliderPlayer[elementId] = new DDSliderPlayer(elementObj, handler, pauseTime, currentClassName);

  11. elementObj.onmouseover = function() {

  12.   ddSliderPlayer[elementId].pause();
  13. }
  14. elementObj.onmouseout = function() {
  15.   ddSliderPlayer[elementId].play();
  16. };
  17. return ddSliderPlayer;
  18. }
  19. function DDSliderPlayer(elementObj, handler, pauseTime, currentClassName) {
  20. this.id = elementObj.id;
  21. this.timer;
  22. this.curScreen = 0;
  23. this.elementObj = elementObj;
  24. this.pauseTime = (undefined == pauseTime) ? 3000 : pauseTime * 1000;
  25. this.currentClassName = (currentClassName == undefined) ? 'sel' : currentClassName;
  26. this.pics = getElementsByClassName('flwi',elementObj);
  27. this.handlers = getElementsByClassName('flNa',handler);
  28. this.maxScreen = this.pics.length;
  29. for (i=0;i<this.handlers.length;i++) {
  30.   this.handlers.setAttribute("index", i);
  31.   var id=this.id;
  32.   this.handlers[i].onmouseover=function(){
  33.    var u = this.getAttribute('index');
  34.    ddSliderPlayer[id].go(u).pause();
  35.   }
  36.   this.handlers[i].onmouseout=function(){
  37.    ddSliderPlayer[id].play();
  38.   }
  39. }
  40. this.go();
  41. if (pauseTime)
  42.   this.play();
  43. }
  44. DDSliderPlayer.prototype.pause = function(){
  45. this.pauseTime && clearInterval(this.timer);
  46. this.timer = null;
  47. };
  48. DDSliderPlayer.prototype.play = function(){
  49. if (!this.timer&&this.pauseTime) this.timer = setInterval('ddSliderPlayer.'+this.id+'.go()', this.pauseTime);
  50. };
  51. DDSliderPlayer.prototype.go = function(t){
  52. this.curScreen = t===undefined ? this.curScreen : t;
  53. this.curScreen %= this.maxScreen;
  54. for (i=0;i<this.maxScreen;i++) {
  55.   if (i == this.curScreen) {
  56.    this.handlers[i].className = 'flNa '+this.currentClassName;
  57.    this.pics[i].style.display = '';
  58.   } else {
  59.    this.handlers[i].className = 'flNa';
  60.    this.pics[i].style.display = "none" ;
  61.   }
  62. }
  63. ++this.curScreen;
  64. return this;
  65. }
  66. function getElementsByClassName (className, parentElement){
  67. if (typeof(parentElement)=='object') {
  68.   var elems = parentElement.getElementsByTagName("*");
  69. } else {
  70.   var elems = (document.getElementById(parentElement)||document.body).getElementsByTagName("*");
  71. }
  72. var result=[];
  73. for (i=0; j=elems[i]; i++) {
  74.     if ((" "+j.className+" ").indexOf(" "+className+" ")!=-1) {
  75.    result.push(j);
  76.     }
  77. }
  78. return result;
  79. }
  80. function ddHSlider(offX,eleid) {
  81. document.getElementById(eleid).scrollLeft+=offX;
  82. }



后台函数标签部分设置隐藏(⊙o⊙)哦,回复可见

以下内容只有回复后才可以浏览,请先登录!

[/i][/i][/i][/i][/i][/i][/i]
 
  支持(2) | 反对(0) 回到顶部顶端 回到底部底部
5kcn 当前离线

1387

主题

7

广播

2

粉丝
添加关注
级别:九年级

用户积分:5750 分
登录次数:328 次
注册时间:2007/11/8
最后登录:2021/5/15
5kcn 发表于:2011/3/22 9:14:45   | 只看该作者 查看该作者主题 沙发 
 
[url]http://www.5kcn.net[/url]
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
一生有你 当前离线

10439

主题

0

广播

18

粉丝
添加关注
级别:版主

用户积分:72521 分
登录次数:1969 次
注册时间:2006/7/1
最后登录:2021/8/25
一生有你 发表于:2011/3/22 9:21:02   | 只看该作者 查看该作者主题 藤椅 
 
我爱世界杯,我爱KesionCMS.
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
yanglxg2010 当前离线

562

主题

13

广播

4

粉丝
添加关注
级别:五年级

用户积分:2810 分
登录次数:158 次
注册时间:2010/3/17
最后登录:2018/10/7
yanglxg2010 发表于:2011/3/22 9:26:22   | 只看该作者 查看该作者主题 板凳 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
lengxue 当前离线

3043

主题

18

广播

4

粉丝
添加关注
级别:大二

用户积分:10430 分
登录次数:1605 次
注册时间:2009/1/13
最后登录:2022/9/16
lengxue 发表于:2011/3/22 10:15:40   | 只看该作者 查看该作者主题 报纸 
 
想旅游就来就爱旅游网
[url]http://bbs.shangrila66.com[/url]
大香格里拉旅游王国
[url]http://www.shangrila66.com[/url]
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
cn8151 当前离线

817

主题

5

广播

0

粉丝
添加关注
级别:七年级

用户积分:9288 分
登录次数:135 次
注册时间:2010/4/9
最后登录:2016/3/17
cn8151 发表于:2011/3/22 12:35:53   | 只看该作者 查看该作者主题 地板 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
百益 当前离线

737

主题

0

广播

0

粉丝
添加关注
级别:六年级

用户积分:3379 分
登录次数:174 次
注册时间:2009/9/7
最后登录:2012/5/2
百益 发表于:2011/3/22 13:03:28   | 只看该作者 查看该作者主题 7楼 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
doufapj 当前离线

209

主题

0

广播

0

粉丝
添加关注
级别:二年级

用户积分:273 分
登录次数:66 次
注册时间:2011/3/21
最后登录:2011/6/30
doufapj 发表于:2011/3/22 16:17:29   | 只看该作者 查看该作者主题 8楼 
 
<a href=http://www.13938920190.com>豆腐皮机</a>http://www.13938920190.com
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
q365 当前离线

130

主题

0

广播

1

粉丝
添加关注
级别:一年级

用户积分:639 分
登录次数:149 次
注册时间:2011/2/3
最后登录:2016/5/8
q365 发表于:2011/3/22 20:56:50   | 只看该作者 查看该作者主题 9楼 
科汛在线网校系统

以下是引用 一生有你在2011-3-22 9:21:02的发言:
感谢分享

不错 不错 支持的人少了

 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
heymi 当前离线

321

主题

15

广播

2

粉丝
添加关注
级别:三年级

用户积分:606 分
登录次数:269 次
注册时间:2010/1/9
最后登录:2023/11/13
heymi 发表于:2011/3/23 15:15:35   | 只看该作者 查看该作者主题 10楼 
科汛在线网校系统
好帖,鼓掌!!!!!
 
,
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
<上一主题 | 下一主题 >
Powered By KesionCMS Version X1
厦门科汛软件有限公司 © 2006-2016 页面执行0.25000秒 powered by KesionCMS 9.0