I have a class called .bxSlider
I want to apply this jQuery to all the .bxSlider Div boxes. However, I want to apply some jQuery to individual boxes.
$(document).ready(function(){
// LOAD ITEM SLIDER
$('.bxslider').bxSlider({
pager:false
});
// BLACK IMAGE HOVERS
$(".bxslider").hover(function() {
$(this)(".bx-wrapper .bx-prev").css("background-image", "url(//www.cdn.com/running/left_arrow_off.png)");
$(this)(".bx-wrapper .bx-next").css("background-image", "url(//www.cdn.com/running/right_arrow_off.png)");
}, function() {
$(this)(".bx-wrapper .bx-prev").css("background-image", "url(//www.cdn.com/running/left_arrow_on.png)");
$(this)(".bx-wrapper .bx-next").css("background-image", "url(//www.cdn.com/running/right_arrow_on.png)");
});
});
The HTML code, so you can see how I am using multiple boxes.
<div class="items">
<div class="bxslider bx-wrapper">
Hello <a class="bx-prev" href=""></a>
Goodbye <a class="bx-next" href=""></a>
</div>
<div class="bxslider bx-wrapper">
Hello <a class="bx-prev" href=""></a>
Goodbye <a class="bx-next" href=""></a>
</div>
</div>
I am using this but I cannot get it to work
Assuming .bx-prev is a child of .bxSlider ie:
.
If you wanted to target a parent of .bx-slider then you can do: