Suppose there is a code on js when scrolling with the mouse that changes, how to make it so that something does not happen on a particular div?

// ------------- DETERMINE DELTA/SCROLL DIRECTION ------------- // function parallaxScroll(evt) { if (isFirefox) { //Set delta for Firefox delta = evt.detail * (-120); } else if (isIe) { //Set delta for IE delta = -evt.deltaY; } else { //Set delta for all other browsers delta = evt.wheelDelta; } if (ticking != true) { if (delta <= -scrollSensitivitySetting) { //Down scroll ticking = true; if (currentSlideNumber !== totalSlideNumber - 1) { currentSlideNumber++; nextItem(); } slideDurationTimeout(slideDurationSetting); } if (delta >= scrollSensitivitySetting) { //Up scroll ticking = true; if (currentSlideNumber !== 0) { currentSlideNumber--; } previousItem(); slideDurationTimeout(slideDurationSetting); } } } 
  • Give a certain diva id and register what he should do - MegaRoks 4:44 pm
  • @ MegaRoks Dear, I did the previous topic with specifics, here is the link: ru.stackoverflow.com/questions/951409/… - Vladimir Rodichev
  • @MegaRoks ask you to help me. You are welcome. - Vladimir Rodichev
  • As I understand it, it is necessary that horizontal scrolling does not work on the third block? - MegaRoks pm
  • @MegaRoks no. It is necessary that horizontal scrolling with content works if the cursor is in <article class = "mario">, when the cursor is in it, so that vertical scrolling of block changes does not work. As soon as the cursor is in not <article class = "mario">, then the scrolling of the vertical block change begins to work and the scrolling of the horizontal in the <article class = "mario"> does not work. I hope I clearly explained. Do you understand me? - Vladimir Rodichev

1 answer 1

Your question in stackoverflow in English was translated not exactly, I will answer here and in the previous topic. For a test site, we do the following code inserts:

index.js:

 var isHorizontal = false; //Global variable function parallaxScroll(evt) { if(isHorizontal) { isHorizontal = false; return; } 

horisontalscroll.js:

 function horizontalScroll(e){ isHorizontal = true; // skipped if(scrollElementToColumn( that, targetColumn )) { e.preventDefault(); } else { isHorizontal = false; } 
  • Good evening, Sergey. Can you help with the code? I want to make it so that on certain divs (with id or by class, whatever you like), for example, divas with scrolling text, so that they can be rotated and at this time the scrolling of the pages does not work. - Vladimir Rodichev
  • Use event.stopPropagation () in event handlers - Sergey Nudnov
  • Yes, already decided. If you are interested, look here at these questions, please: ru.stackoverflow.com/questions/960023 - Vladimir Rodichev
  • ru.stackoverflow.com/questions/960283 It would be great to combine both options. - Vladimir Rodichev
  • Here I did not come across a svayp yet. More on the desktops ... - Sergey Nudnov