Ok, ich hab den Code angepasst.
Die Klasse wird auch im ersten Slider Element vergeben, doch beim Sliden zum nächsten Element verändert sie sich leider nicht. Das erste Element bleibt weiter "visible" und das zweite bekommt diese Klasse leider nicht mehr.
Die Globalen
Code:
// global options
if ($this->carouselType) {
echo ($oComma == true ? ', ' : '') . $this->carouselType;
$oComma = true;
}
if ($this->responsive) {
echo ($oComma == true ? ', ' : '') . $this->responsive;
$oComma = true;
}
if ($this->direction) {
echo ($oComma == true ? ', ' : '') . $this->direction;
$oComma = true;
}
if ($this->width) {
echo ($oComma == true ? ', ' : '') . $this->width;
$oComma = true;
}
if ($this->height) {
echo ($oComma == true ? ', ' : '') . $this->height;
$oComma = true;
}
if ($this->align) {
echo ($oComma == true ? ', ' : '') . $this->align;
$oComma = true;
}
if ($this->padding) {
echo ($oComma == true ? ', ' : '') . $this->padding;
$oComma = true;
}
if ($this->cookie) {
echo ($oComma == true ? ', ' : '') . $this->cookie;
$oComma = true;
}
echo ($oComma == true ? ', ' : '') . 'onCreate: function(data) { data.items.addClass("visible"); }';
Und Scroll
Code:
// subobject 'scroll' options
if ($this->scrollItems || $this->scrollFx || $this->scrollEasing || $this->scrollDuration || $this->scrollPauseOnHover) {
echo ($oComma == true ? ', ' : '') . 'scroll: { ';
if ($this->scrollItems) {
echo ($iComma == true ? ', ' : '') . $this->scrollItems;
$iComma = true;
}
if ($this->scrollFx) {
echo ($iComma == true ? ', ' : '') . $this->scrollFx;
$iComma = true;
}
if ($this->scrollEasing) {
echo ($iComma == true ? ', ' : '') . $this->scrollEasing;
$iComma = true;
}
if ($this->scrollDuration) {
echo ($iComma == true ? ', ' : '') . $this->scrollDuration;
$iComma = true;
}
if ($this->scrollPauseOnHover) {
echo ($iComma == true ? ', ' : '') . $this->scrollPauseOnHover;
$iComma = true;
}
// echo ($iComma == true ? ', ' : '') . 'conditions: function(direction) { }';
echo ($iComma == true ? ', ' : '') . 'onBefore: function(data) { data.items.old.removeClass("visible"); }';
if (!$this->autoPlay && $this->autoProgress == 'pie') {
echo ($iComma == true ? ', ' : '') . 'onBefore: function(data) { $().hideProgressBar("caroufredsel_bar_wrapper_' . $this->id . '"); }';
}
echo ($iComma == true ? ', ' : '') . 'onAfter: function(data) { data.items.visible.addClass("visible"); }';
if (!$this->autoPlay && $this->autoProgress == 'pie') {
echo ($iComma == true ? ', ' : '') . 'onAfter: function(data) { $().initProgressBar("caroufredsel_bar_' . $this->id . '", { barBackgroundColor: progressBarBackgroundColor_' . $this->id . ' }); }';
}
// echo ($iComma == true ? ', ' : '') . 'onEnd: function(direction) { }';
echo ' }';
$iComma = false; // reset inside subobject comma flag
$oComma = true;
}
Lesezeichen