私はこれを持っています:
$('#mask').cycle({
fx: 'scrollLeft',
timeout: 0,
speed: 300,
startingSlide: 0
});
しかし、fx を scrollRight にしたい特定のケースがあります (myCondition == true)
それ、どうやったら出来るの?
私はこれを持っています:
$('#mask').cycle({
fx: 'scrollLeft',
timeout: 0,
speed: 300,
startingSlide: 0
});
しかし、fx を scrollRight にしたい特定のケースがあります (myCondition == true)
それ、どうやったら出来るの?
これはうまくいくはずです..
(myCondition == true) ? _fx = "scrollLeft" : _fx = "scrollRight";
$('#mask').cycle({
fx: _fx,
timeout: 0,
speed: 300,
startingSlide: 0
});
ただし、関数を作成する方が賢明でしょう_fx()
..
function _fx(c) {
return (c == true) ? "scrollLeft" : "scrollRight";
}
これはどういう意味ですか:
var myFx = 'scrollLeft';
if( window.location.href.indexOf('myCondition=true') != -1 ) {
myFx = 'scrollRight';
}
$('#mask').cycle({
fx: myFx,
timeout: 0,
speed: 300,
startingSlide: 0
});
私は四肢に出て、右にスクロールするfx:
にはscrollRightに変更すると想定しています。その場合
if(myCondition == true) {
$('#mask').cycle({
fx: 'scrollRight',
timeout: 0,
speed: 300,
startingSlide: 0
});
} else {
$('#mask').cycle({
fx: 'scrollLeft',
timeout: 0,
speed: 300,
startingSlide: 0
});
}