我有一堂课叫.bxSlider
我想将此 jQuery 应用到所有.bxSlider
Div 框。但是,我想将一些 jQuery 应用于单个框。
$(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)");
});
});
HTML 代码,因此您可以看到我是如何使用多个框的。
<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>
我正在使用this
,但我无法让它工作