简体   繁体   English

如何将下一张和上一张幻灯片的名称悬停在下一个和上一个按钮上?

[英]How to hover the name of the next and previous slide on the next and previous button?

I need your help to implement a hover function on the arrows of the slider showing the name of the next slide on the "next" arrow and the name of previous slide on the "prev" arrow. 我需要您的帮助,以在滑块的箭头上实现悬停功能,在“下一个”箭头上显示下一张幻灯片的名称,在“上一条”箭头上显示上一张幻灯片的名称。

I tried to code it with jQuery but I can't seem to get it working. 我尝试使用jQuery进行编码,但似乎无法正常工作。

Thanks for you help! 感谢您的帮助!

You can implement it like; 您可以像这样实现它;

$("#next").mouseenter(function () {
    // Next slide name
    $(this).html("N1");
});
$("#next").mouseleave(function () {
    $(this).html("Next");
});

$("#prev").mouseenter(function () {
    // Prev slide name
    $(this).html("P1");
});
$("#prev").mouseleave(function () {
    $(this).html("Prev");
});

jsfiddle link jsfiddle 链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM