Flex 悬停幻灯片:悬停时旋转不起作用

问题描述 投票:0回答:0

我正在尝试使此悬停幻灯片在我的网站上运行:

    [codepen](https://codepen.io/CameronFitzwilliam/pen/rmeMGr)

到目前为止的结果还不错:

https://www.merlinsmind.be/Test.html

但是,我在旋转功能方面遇到问题。

    (function(){
    $('.flex-container').waitForImages(function() {
        $('.spinner').fadeOut();
    }, $.noop, true);
    
    $(".flex-slide").each(function(){
        $(this).hover(function(){
            $(this).find('.flex-title').css({
                transform: 'rotate(0deg)',
                top: '10%'
            });
            $(this).find('.flex-about').css({
                opacity: '1'
            });
        }, function(){
            $(this).find('.flex-title').css({
                transform: 'rotate(90deg)',
                top: '15%'
            });
            $(this).find('.flex-about').css({
                opacity: '0'
            });
        })
    });
})();

到目前为止我已尝试解决此问题的步骤:

  • 切换脚本在 html 中的位置
  • 将现有脚本和现有CSS一一删除,以确保不存在冲突

但是,我无法让它工作。有人知道我忽略了什么吗?

提前非常感谢!

亲切的问候

javascript css flexbox hover slide
© www.soinside.com 2019 - 2024. All rights reserved.