我是網絡編程新手,對三元運算符沒有太多的瞭解。我發現了一些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