Home Ask Login Register

Developers Planet

Your answer is one click away!

Łukasz Górski February 2016

Owl Carousel 2 - First and Last .active - add Opacity

Can someone help me with styling Owl Carousel 2? I have 7 items in a row. Need to add for first and last CSS opacity 0.3.

Print Screen of project

I was trying add something like this:

$(window).load(function(){
         $('.active').eq(0).css("opacity", "0.3");
         $('.active').eq(6).css("opacity", "0.3");
        })

But it works only when page loads, after slide it dont change to "new first". Without window.load does not work at all.

I was thinking about giving two DIV's (left and right) - with z-index, white background and cover first and last item, but this method kind of sucks I think.

Answers


Ashish Patel February 2016

Try this hopefully help.

You can use just simple css for first and last element

<style>
p:first-child, p:last-child {
   opacity: 0.3;
}
</style>

Post Status

Asked in February 2016
Viewed 2,410 times
Voted 9
Answered 1 times

Search




Leave an answer


Quote of the day: live life