0
我剛剛從一個教程捏這個腳本。它做的一切,我需要 - 沿多張幻燈片和步驟選擇「當前」jQuery的旋轉木馬滾動
但它確實有一個錯誤,即如果步驟有滑梯比級差量較少,它不會一步到位的。
<script language="javascript">
jQuery(function() {
var step = 8;
var current = 10;
var maximum = jQuery('#thumb-nav-inner ul li').size();
var visible = 8;
var speed = 500;
var liSize = 114;
var carousel_height = 93;
var ulSize = liSize * maximum;
var divSize = liSize * visible;
jQuery('#thumb-nav-inner ul').css("width", ulSize+"px").css("left", -(current * liSize)).css("position", "absolute");
jQuery('#thumb-nav-inner').css("width", divSize+"px").css("height", carousel_height+"px").css("visibility", "visible").css("overflow", "hidden").css("position", "relative");
jQuery('#right-thumb-scroll').click(function() {
if(current + step < 0 || current + step > maximum - visible) {return; }
else {
current = current + step;
jQuery('#thumb-nav-inner ul').animate({left: -(liSize * current)}, speed, null);
}
return false;
});
jQuery('#left-thumb-scroll').click(function() {
if(current - step < 0 || current - step > maximum - visible) {return; }
else {
current = current - step;
jQuery('#thumb-nav-inner ul').animate({left: -(liSize * current)}, speed, null);
}
return false;
});
});
任何人都可以與固定幫助呢?
謝謝你們!
是的,這是有道理的,這是我在哪裏看,但我不確定如何使這些jQuery的計算 - 你能幫忙嗎?乾杯! – Infocentre