我正在使用Slick滑块,我希望在将鼠标悬停在其上后将左右箭头文本更改为(next和prev)。我怎么能用javascript函数做到这一点?
<div class="left-slider-arrow slider-arrow">
<i class="fa fa-chevron-left" aria-hidden="true"></i>
</div>
<div class="right-slider-arrow slider-arrow">
<i class="fa fa-chevron-right" aria-hidden="true"></i>
</div>
$(".left-slider-arrow").click(function(){
//now which text to change?
});
答案 0 :(得分:1)
只需编辑slick-theme.css,观看第89行和第107行
.slick-next:before
{
content: '→';
}
[dir='rtl'] .slick-next:before
{
content: '←';
}
.slick-prev:before
{
content: '←';
}
[dir='rtl'] .slick-prev:before
{
content: '→';
}
将'←'替换为“nedded text”......