【问题标题】:How to hover the name of the next and previous slide on the next and previous button?如何将下一张和上一张幻灯片的名称悬停在下一张和上一张按钮上?
【发布时间】:2014-05-17 19:39:26
【问题描述】:

我需要您帮助在滑块的箭头上实现悬停功能,在“下一张”箭头上显示下一张幻灯片的名称,在“上一张”箭头上显示上一张幻灯片的名称。

我尝试使用 jQuery 对其进行编码,但似乎无法正常工作。

感谢您的帮助!

【问题讨论】:

  • 您的代码将构建您的代码在哪里
  • 你能发布一些你目前正在使用的代码吗?没有它,我们什么都做不了。
  • 工具提示只使用title 属性?

标签: javascript jquery html


【解决方案1】:

你可以像这样实现它;

$("#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

【讨论】:

  • 您好,感谢您的回答。我做了一个类似的悬停功能,但名称必须更改(我有 5 张幻灯片)。您是否知道如何根据下一张或上一张幻灯片更改名称来实现它?再次感谢
猜你喜欢
  • 2015-11-20
  • 1970-01-01
  • 1970-01-01
  • 2017-09-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多