【问题标题】:jCarousel show arrows only when mouseover the containerjCarousel 仅在将鼠标悬停在容器上时显示箭头
【发布时间】:2013-07-25 19:49:46
【问题描述】:

我试图让 jCarousel 的箭头仅在我将鼠标悬停在容器上时显示(我将在同一页面中有多个容器)

但我什至不知道如何解决这个问题。

是否有人对如何做到这一点有任何提示?

不胜感激!

【问题讨论】:

  • 你有什么已经尝试过的东西吗?
  • 我只能使用 CSS '.jcarousel-container-horizo​​ntal:hover .jcarousel-prev' 来修复它

标签: javascript jquery drupal mouseover jcarousel


【解决方案1】:

首先你必须默认隐藏你的箭头,所以在 CSS 中这样做:

.arrow-class {display:none;}

然后使用 jquery 在您将鼠标悬停在图像上时显示

$(".image-class").hover(function(){
    $(".arrow-class").show(); //this happens when you mouse in
}, 
function(){
    $(".arrow-class").hide(); //this happens when you mouse out
});

【讨论】:

  • 我实际上只用 CSS 完成了它。当他们将鼠标悬停在容器上时,调用按钮类来显示它!不过,我很感谢您的回复!
  • 确保它适用于所有浏览器。其他一些浏览器只尊重锚点上的 :hover 选择器 ()
猜你喜欢
  • 1970-01-01
  • 2013-01-04
  • 1970-01-01
  • 2019-09-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-03
相关资源
最近更新 更多