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

156
Views
how to stop scroll to specific Div but allow image to slide

i am using #id on 3 buttons to change image on Slides , but i dont want to scroll to images slide section when i click on button just want to slide image to next without scrolling to image section here is drive video link to show how my web is looking right now https://drive.google.com/file/d/1dXMCeBNzkn2c5ChNQfOAVthNBHHsePSp/view?usp=drivesdk

    <div className="carousel carousel-center max-w-md   md:max-w-screen-2xl mx-auto  space-x-24 ">
        <div id="item1" className="carousel-item">
          <img src="/BingWallpaper.jpg" width={896} className="rounded-box" alt="image1" />
        </div> 
        <div id="item2"  className="carousel-item " >
          <img src="/BingWallpaper.jpg" width={896} className="rounded-box"  alt="image2" />
        </div> 
        <div id="item3"  className="carousel-item">
          <img src="/BingWallpaper.jpg" width={896} className="rounded-box" alt="image3" />
        </div> 
      </div>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just add an event listener to your buttons and prevent the default behaviour. Add an id of "link" to the button and then add an event listener like below. If your button element contains an anchor tag, add the "link" id to anchor tag instead of button.

document.getElementById("link").addEventListener("click", (e) => {
  e.preventDefault();
});
about 4 years ago · Juan Pablo Isaza Report
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!