[英]jquery code working with version 1.7.1 but not with latest version
i'm using a jquery code on my website to control a slideshow. 我在我的网站上使用jQuery代码来控制幻灯片显示。 i've collected some codes supposed to work with jquery version 1.7.1.
我已经收集了一些应该与jquery版本1.7.1一起工作的代码。 it works perfectly, but when using jquery latest version my code doesn't work.
它完美地工作,但是当使用最新版本的jQuery时,我的代码不起作用。 is there a lot of difference between those 2 versions ?
这两个版本之间有很多区别吗? is there a way of fixing it because I would like to use jquery latest version.
有没有解决的方法,因为我想使用jQuery的最新版本。
here is my js code : 这是我的js代码:
function slideshow(){
var $descriptions = $('#carousel-descriptions').children('li'),
$controls = $('#carousel-controls').find('span'),
$carousel = $('#carousel')
.roundabout({childSelector:"li", minOpacity:0, maxOpacity:1, minScale: 1, btnNext: ".next", btnPrev:".prev",})
.on('focus', 'li', function() {
var slideNum = $carousel.roundabout("getChildInFocus");
$descriptions.add($controls).removeClass('current');
$($descriptions.get(slideNum)).addClass('current');
$($controls.get(slideNum)).addClass('current');
});
$controls.on('click dblclick', function() {
var slideNum = -1,
i = 0, len = $controls.length;
for (; i<len; i++) {
if (this === $controls.get(i)) {
slideNum = i;
break;
}
}
if (slideNum >= 0) {
$controls.removeClass('current');
$(this).addClass('current');
$carousel.roundabout('animateToChild', slideNum);
}
});
}
I can also do a jsfiddle if needed, but maybe someone can see conflicts with new jquery version in my code ? 如果需要的话,我也可以做一个jsfiddle,但是也许有人可以在我的代码中看到与新jquery版本的冲突?
thanks a lot for your help, 非常感谢你的帮助,
加载jQuery后,使用: http : //code.jquery.com/jquery-migrate-1.2.1.js ,这应该会有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.