jcarousellite在jquery 1.2下出错的问题

相关网站:
www.jquery.com Jquery官网
http://jquery.com/plugins/project/jCarouselLite jCarouselLite插件

插件作者可能很久没更新了,他是用的.1.1.3版本的好象。现在Jquery 1.2.1版本了,发现会出错
网上搜了下,没有找到相关的升级
只能自己找原因了。
感谢FF的JS出错提示。原来是Jquery原来有的.gt 和.lt的方法没有了。取代他的是.slice方法

.gt方法的说明

将匹配的元素集合缩减为给定位置之后的所有元素。这个元素在匹配元素集合中的位置变为0,而长度变成1 
Reduce the set of matched elements to all elements after a given position. The position of the element in the set of matched elements starts at 0 and goes to length - 1.
[
示例]:
$("p").gt(0)
HTML
标记:
<p>This is just a test.</p><p>So is this</p>
结果:
<p>So is this</p> ]


原.lt方法的说明

将匹配的元素集合缩减为给定位置之前的所有元素。这个元素在匹配元素集合中的位置变为0,而长度变成1。 
Reduce the set of matched elements to all elements before a given position. The position of the element in the set of matched elements starts at 0 and goes to length - 1.
[示例]:
$("p").lt(1)
HTML标记:
<p>This is just a test.</p><p>So is this</p>
结果:
<p>This is just a test.</p> ]


现在取代他的.slice和数组的方法相同

slice 方法 (Array)
返回一个数组的一段。

arrayObj.slice(start, [end]) 

参数
arrayObj

必选项。一个 Array 对象。 

start 

必选项。arrayObj 中所指定的部分的开始元素是从零开始计算的下标。 

end 

可选项。arrayObj 中所指定的部分的结束元素是从零开始计算的下标。

说明
slice 方法返回一个 Array 对象,其中包含了 arrayObj 的指定部分。 

slice 方法一直复制到 end 所指定的元素,但是不包括该元素。如果 start 为负,将它作为 length + start处理,此处 length 为数组的长度。如果 end 为负,就将它作为 length + end 处理,此处 length 为数组的长度。如果省略 end ,那么 slice 方法将一直复制到 arrayObj 的结尾。如果 end 出现在 start 之前,不复制任何元素到新数组中。

示例
在下面这个例子中,除了最后一个元素之外,myArray 中所有的元素都被复制到 newArray 中: 

newArray = myArray.slice(0, -1)


也就是说。原来是.gt(n)那么现在就要表示成.slice(n+1)
原来.lt(n)现在要表示成.slice(0,n)

把插件JS中的.gt和.lt改下OK了。。

posted @ 2007-09-30 11:52  TT.Net  阅读(955)  评论(0编辑  收藏  举报