Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

400
Views
How to add modal inside swiper slider?

My code:

 <div class="tab-pane fade in active" id="home">
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
                <a href="www.example.com" data-toggle="modal" data-target="#123" onclick="window.open(this.href, '_blank');">
                    <span class="coupon-code-value">123</span>
                </a>
            </div>
        </div>
        ....
    </div>
    <div class="dhs-controls">
        <div class="dhs dhs-prev"></div>
        <div class="dhs dhs-next"></div>
    </div>
</div>


<!-- Modal -->
<div id="123" class="modal fade">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            ...
        </div>
    </div>
</div>
....

//script for swiper slider

var swiper = new Swiper(".swiper-container", {
            preloadImages: false,
            freeMode: false,
            slidesPerView: 1,
            spaceBetween: 10,
            loop: false,
            grabCursor: true,
            mousewheel: false,
            observer: true,
            observeParents: true,

            navigation: {
                nextEl: '.dhs-next',
                prevEl: '.dhs-prev',
            }
        });

In above code, both tabs and slider are working fine. Modal div exist in the code. But Modal popup is not showing when I click the modal link.

I have tried giving highest z-index value for modal class and also tried giving negative z-index value to swiper-container class. Still its not working..

Can anyone please tell me where I am doing wrong? Is it possible that modal works with slider?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!