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

191
Views
Swiper.js Carousel How to control multiple carousel with middle mouse at the same time

I have 5 carousel on the screen they all are controlled by same navigation buttons.I also need to control them with middle mouse scroll. When i activate mouse wheel control only the carousel which mouse is on top is moving when scrolled. I need to move them all.

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

0

I don't know if there is a better solution but i did it this way.

// Wheel Control on Carousels

$( '#body' ).on( 'mousewheel', function ( event ) {
  if ( typeof event.originalEvent.wheelDeltaY === 'undefined' ) {
  console.log( "could not find mouse deltas" )
}
var deltaY = event.originalEvent.wheelDeltaY;
var scrolledUp = deltaY < 0;
var scrolledDown = deltaY > 0;
if ( scrolledUp ) {
  if (swiper_color.activeIndex > 2) {
goTop();
  }else{
  swiper_color.slidePrev();
  swiper_image.slidePrev();
  swiper_desc.slidePrev();
  swiper_title.slidePrev();
  swiper_jar.slidePrev();
  }
  }
  if ( scrolledDown ) {
if (swiper_color.activeIndex < 2) {
  swiper_color.slideNext();
  swiper_image.slideNext();
  swiper_desc.slideNext();
  swiper_title.slideNext();
  swiper_jar.slideNext();
}else{
  checkscroll();
}
   }
});
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!