我是网络编程新手,对三元运算符没有太多的了解。我发现了一些jQuery滑块的示例代码,但我需要对其进行编辑,以便在用户将鼠标移动到横幅上时停止。我希望有人能帮我把下面的代码变成一组简单的if和else if语句,我更习惯于处理。提前致谢。将以下三元运算符转换为常规if语句?
//Get next image, when it reaches the end, rotate it back to the first image
var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div.rotator ul li:first') :current.next()) : $('div.rotator ul li:first'));
开始向外你的工作方式。 – Jon