Parašė Valuediz· 2008 Lie. 24 14:07:24
#1
kaip pakeist šitą skripta, kad veiktu ne su sąrašu<ul>, o su lentele?
reikalinga skripto dalis:
function initPage(){
var _gallery = "#tab1 .gallery-content";
var _leftArrow = "#tab1 .prev";
var _rightArrow = "#tab1 .next";
//var _step = 405;
var _duration = 1800;
var _liPadding = 34;
var _gWidth = $(_gallery).width() + _liPadding ;
var _liWidth = $(_gallery+" li").width() + _liPadding;
var _liSum = $(_gallery+" li").length * _liWidth;
var _margin = 0;
var f = 0;
_step = _gWidth;
$(_rightArrow).click(function(){
if (_liSum - _gWidth <= _margin + _step) {
if (f == 0) {
_margin = _liSum - _gWidth
f = 1;
} else {
_margin = 0;
f = 0
}
}
else _margin = _margin + _step;
$(_gallery+" ul").animate({marginLeft: -_margin+"px"}, {queue:false,duration:_duration });
return false;
});
$(_leftArrow).click(function(){
_margin = _margin - _step;
if (_margin < 0) _margin = 0;
$(_gallery + " ul").animate({
marginLeft: -_margin + "px"
{
queue:false, duration: _duration
});
return false;
});