I have an issue with what seemed a simple task, but I'm having a brain farth, so it's not :)
I count child elements with length
and add +1
on top of that length. This works fine and I store that in a var $trackCount
$trackCount = $carousel.find('.owl-item').length +1;
Now I want to get that variable in a .css() method which I normally have no issues with if it only needs to be a property value, but now I need to extend a property value with my var.
So I have to get the following where the number (in this example, 8) needs to be my $trackCount
var.
$carousel.find('.owl-wrapper').css('counter-reset','tracks 8' );
I tried several things with wrapping $trackCount
in +
signs and single '
and double "
quotes or a combination of them, but with no luck so far.