AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / coding / Perguntas / 79564364
Accepted
Andre Sexton
Andre Sexton
Asked: 2025-04-09 20:38:49 +0800 CST2025-04-09 20:38:49 +0800 CST 2025-04-09 20:38:49 +0800 CST

Por que os links nos cartões dentro deste carrossel do Flickity não estão funcionando?

  • 772

Tenho um carrossel do Flickity no meu site, preenchido por um bloco PHP. Tudo renderiza corretamente, mas não consigo entender por que os links não estão funcionando. Você pode ver uma demonstração ao vivo aqui: https://sc.apexl.io/swimming-lessons/adult-and-child-swimming-lessons/ (role para baixo até a seção "De criança a titã..."). Suspeito que tenha algo a ver com a capacidade de clicar/arrastar dos cartões. Agradeço desde já!

HTML:

    <div class="container card-carousel-header"<?php if (get_field('remove_top_margin')): ?> style="margin-top:0;"<?php endif; ?>>
        <div class="row">
            <h2 class="animated-underline-effect">
                <span class="animated-underline"><?php the_field('heading'); ?></span>
            </h2>
        </div>
    </div>
<?php endif; ?>

<?php
$start_index = get_field('default_slide');
$start_index = is_numeric($start_index) ? intval($start_index) : 1;
$start_index = $start_index - 1;
?>

<div class="carousel-course-card" data-flickity='{ "freescroll": false, "pageDots": false, "wrapAround": false, "initialIndex": <?php echo $start_index; ?> }'<?php if (get_field('remove_bottom_margin')): ?> style="margin-bottom:0;"<?php endif; ?>>

    <?php $counter = 0; // Initialize a counter for unique IDs ?>
    <?php while (have_rows('carousel_repeater')): the_row(); ?>

        <div class="carousel-course-card-cell">
            <div class="card-cell-content">
                <div class="card-cell-text">
                    <h3>
                        <?php the_sub_field('name'); ?>
                    </h3>
                    <p class="card-subtitle">
                        <?php the_sub_field('subtitle'); ?>
                    </p>
                </div>
            </div>
            <div class="card-cell-thumbnail">
                <img src="<?php the_sub_field('image'); ?>" alt=""/>
            </div>
            <div class="card-cell-button" id="button-<?php echo $counter; ?>">
                <?php
                $cta = get_sub_field('call_to_action');
                ?>
                <?php if ($cta == 'book'): ?>
                    <a href="https://mightysplash-bookings.swimphony.io/" target="_blank">Click here to book your lesson</a>
                <?php elseif ($cta == 'learn'): ?>
                    <a href="<?php the_sub_field('card_link'); ?>">Click here to learn more</a>
                <?php endif; ?>
            </div>
        </div>
        <?php $counter++; // Increment the counter ?>
    <?php endwhile; ?>
</div>

CSS:

    margin-top: 6rem;
    margin-bottom: -6rem;
    text-align: center;
    color: @msorange;
}

.carousel-course-card:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to top, white 0%, white 30%, #e17122 30%, #e17122 70%, white 70%, white 100%);
    background-repeat: repeat-x;
    transform: skewY(1deg);
    transform-origin: bottom;
    will-change: transform;
    z-index: -1;
}

.carousel-course-card {
    padding: 3rem 0;
    margin: 2rem auto;
    position: relative;
    background-image: url('/wp-content/uploads/mighty-splash/ms-orange-dots-down.svg');
    background-repeat: repeat-x;
    background-position: 0 90%;
    background-size: 100%;

    .carousel-course-card-cell {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        width: 450px;
        height: 500px;
        margin: 50px 20px 50px 20px;
        background: #fff;
        border-radius: 2px;
        text-align: center;
        counter-increment: carousel-cell;
        opacity: 0.5;
        transition: box-shadow 0.8s, opacity 0.5s;
    }

    .carousel-course-card-cell.is-selected {
        box-shadow: 5px 5px 5px rgba(0,0,0,.2), 10px 10px 30px rgba(0,0,0,.3);
        opacity: 1;
    }
    
    .carousel-course-card-cell {
        .card-cell-content {
            width: 100%;
            padding: 20px;
            align-content: center;
            
            .card-cell-text {
                width: 90%;
                margin: 0 auto;
                
                h3 {
                    margin: 0 auto;
                    color: @msdarkblue;
                }
                
                p.card-subtitle {
                    font-family: Action-Man;
                    margin: 0 auto;
                    color: @mspink;
                }
            }
        }
        
        .card-cell-info-container {
            width: 100%;
            margin: auto;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            
            .card-cell-info {
                margin-bottom: 30px;
                display: flex;
                flex-direction: row;
                text-align: left;
                
                h4 {
                    margin: 0;
                    font-size: 16px;
                    font-weight: 500;
                }
                
                i {
                    font-size: 25px;
                    margin-right: 20px;
                    color: #ff4e00
                }
            }
            
            .card-cell-info:last-of-type {
                margin: 0;
            }
        }
        
        .card-cell-thumbnail {
            width: 100%;
            height: auto;
            padding: 1px;
            
            img {
                width: 100%;
                max-height: auto;
                padding: 0;
                margin: 0;
            }
        }

        .card-cell-button {
            width: 100%;
            height: 100px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            
            a {
                font-family: Action-Man;
                text-decoration: none;
                color: @msdarkblue;
            }
        }
    }
}

.flickity-prev-next-button.next {
    right: 25vw !important;
}

.flickity-prev-next-button.previous {
    left: 25vw !important
}

.flickity-button {
    transition: filter 0.5s;
}

.flickity-button, .flickity-button:hover {
    background: #ddd !important;
    color: #fff !important;
}

.flickity-button:hover .flickity-button-icon {
    fill: white !important;
}

.flickity-button:hover {
    filter: drop-shadow(0px 0px 30px rgba(255,78,0,0.5));
}

@media only screen and (max-width: @mediaBreakMedium) {
    .flickity-prev-next-button.next {
        right: 5vw !important;
    }
    .flickity-prev-next-button.previous {
        left: 5vw !important;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.75);

    .modal-content {
        background-color: #fefefe;
        padding: 20px;
        border: 1px solid #888;
        width: 80% !important;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-height: 75vh;
        overflow: scroll;

        .close-button {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
        }

        .close-button:hover, .close-button:focus {
            color: black;
            text-decoration: none;
            cursor: pointer;
        }
    }
}
  • 1 1 respostas
  • 20 Views

1 respostas

  • Voted
  1. Best Answer
    Артур Димерчан
    2025-04-09T23:32:42+08:002025-04-09T23:32:42+08:00

    Parece que seu problema está relacionado ao JS. Verifique este arquivo https://sc.apexl.io/wp-content/themes/swim-central-child/scripts/main.js?ver=1.0

        $('.card-cell-button').click(function(event) {
            event.preventDefault();
    
            var buttonId = $(this).attr('id');
            var infoId = 'info-' + buttonId.split('-')[1];
            var infoContent = $('#' + infoId).html();
    
            $('#modal-info-content').html(infoContent);
            $('#fullscreen-modal').show();
            $('body').css('overflow', 'hidden'); //prevent scrolling
        });
    
    • 1

relate perguntas

  • Adicionar número de série para atividade de cópia ao blob

  • A fonte dinâmica do empacotador duplica artefatos

  • Selecione linhas por grupo com 1s consecutivos

  • Lista de chamada de API de gráfico subscritoSkus estados Privilégios insuficientes enquanto os privilégios são concedidos

  • Função para criar DFs separados com base no valor da coluna

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Reformatar números, inserindo separadores em posições fixas

    • 6 respostas
  • Marko Smith

    Por que os conceitos do C++20 causam erros de restrição cíclica, enquanto o SFINAE antigo não?

    • 2 respostas
  • Marko Smith

    Problema com extensão desinstalada automaticamente do VScode (tema Material)

    • 2 respostas
  • Marko Smith

    Vue 3: Erro na criação "Identificador esperado, mas encontrado 'import'" [duplicado]

    • 1 respostas
  • Marko Smith

    Qual é o propósito de `enum class` com um tipo subjacente especificado, mas sem enumeradores?

    • 1 respostas
  • Marko Smith

    Como faço para corrigir um erro MODULE_NOT_FOUND para um módulo que não importei manualmente?

    • 6 respostas
  • Marko Smith

    `(expression, lvalue) = rvalue` é uma atribuição válida em C ou C++? Por que alguns compiladores aceitam/rejeitam isso?

    • 3 respostas
  • Marko Smith

    Um programa vazio que não faz nada em C++ precisa de um heap de 204 KB, mas não em C

    • 1 respostas
  • Marko Smith

    PowerBI atualmente quebrado com BigQuery: problema de driver Simba com atualização do Windows

    • 2 respostas
  • Marko Smith

    AdMob: MobileAds.initialize() - "java.lang.Integer não pode ser convertido em java.lang.String" para alguns dispositivos

    • 1 respostas
  • Martin Hope
    Fantastic Mr Fox Somente o tipo copiável não é aceito na implementação std::vector do MSVC 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant Encontre o próximo dia da semana usando o cronógrafo 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor O inicializador de membro do construtor pode incluir a inicialização de outro membro? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský Por que os conceitos do C++20 causam erros de restrição cíclica, enquanto o SFINAE antigo não? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul O C++20 mudou para permitir a conversão de `type(&)[N]` de matriz de limites conhecidos para `type(&)[]` de matriz de limites desconhecidos? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann Como/por que {2,3,10} e {x,3,10} com x=2 são ordenados de forma diferente? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller O ponto e vírgula agora é opcional em condicionais bash com [[ .. ]] na versão 5.2? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench Por que um traço duplo (--) faz com que esta cláusula MariaDB seja avaliada como verdadeira? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng Por que `dict(id=1, **{'id': 2})` às vezes gera `KeyError: 'id'` em vez de um TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob: MobileAds.initialize() - "java.lang.Integer não pode ser convertido em java.lang.String" para alguns dispositivos 2024-03-20 03:12:31 +0800 CST

Hot tag

python javascript c++ c# java typescript sql reactjs html

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve