0

I used the option autoScrollingMode: "always" but autoScrolling still stops when the user moves the mouse over the left or right hotspot or uses the mouse wheel. Contrary to the description the hotspots are not disabled. How can I with on auto scrolling without stopping. Her is my code:

<script type="text/javascript">
    $(document).ready(function() {
        $("#makeMeScrollable").smoothDivScroll({ 
            mousewheelScrolling: true,
            manualContinuousScrolling: true,
            visibleHotSpotBackgrounds: "onstart",
            autoScrollingMode: "always",
            hotSpotScrollingStep: "5",
            hotSpotsVisibleTime: "2000"
        });
    });
</script>

Thanks for your help, Afrikpit

afrikapit
  • 29
  • 1
  • 9
  • I would like to add that I am seeing this exact same issue. When you set autoScrollingMode to "always" the mousewheel and hotspot interactions should be disabled entirely, but they are not. For me it works correctly in the Safari browser, but is broken in all other browsers I tested with: Chrome, Firefox and Opera (Mac OS 10.9). – Ezra Free Oct 26 '13 at 17:24

3 Answers3

0

If you want autoscrolling, this setup should be enough:

<script type="text/javascript">
    $(document).ready(function() {
        $("#makeMeScrollable").smoothDivScroll({ 
            autoScrollingMode: "always"
        });
    });
</script>

This means that the scroller will scroll automatically all the time without interference from the user. Or did you look for a different setup?

tkahn
  • 1,407
  • 2
  • 21
  • 37
0

use autoScrollingMode: "onStart"

djames
  • 366
  • 5
  • 17
0

Okay, I've fixed it on mine by editing the source a bit to disable mousewheel scrolling.

On lines 337-355 of jquery.smoothDivScroll.js (not the .min.js) I commented out all the self.stopAutoScrolling(); and self.move(pixels); lines:

if (o.mousewheelScrolling === "vertical" && deltaY !== 0) {
    // Stop any ongoing auto scrolling if it's running
    // self.stopAutoScrolling();
    event.preventDefault();
    // pixels = Math.round((o.mousewheelScrollingStep * deltaY) * -1);
    // self.move(pixels);
} else if (o.mousewheelScrolling === "horizontal" && deltaX !== 0) {
    // Stop any ongoing auto scrolling if it's running
    // self.stopAutoScrolling();
    event.preventDefault();
    // pixels = Math.round((o.mousewheelScrollingStep * deltaX) * -1);
    // self.move(pixels);
} else if (o.mousewheelScrolling === "allDirections") {
    // Stop any ongoing auto scrolling if it's running
    // self.stopAutoScrolling();
    event.preventDefault();
    // pixels = Math.round((o.mousewheelScrollingStep * delta) * -1);
    // self.move(pixels);
}

Then I changed line 364 to:

el.data("scrollingHotSpotLeft").add(el.data("scrollingHotSpotRight")).add(el.data("scrollWrapper")).mousewheel(function (event) {

I just added the .add(el.data("scrollWrapper")) part to also disable mousewheel scrolling on the entire area.

Doing this made it scroll a little faster so I had to adjust my autoScrollingInterval setting but it seems to disable the mousewheel scrolling for me anyway. The default settings at the top are a good start for disabling hotspot scrolling (I have it disabled by default in the options at the top of jquery.smoothDivScroll.js and don't see any hotspots).

Then just minify the code back to your jquery.smoothDivScroll.min.js file and you should be set. In the end my config looks like this:

$(document).ready(function() {

    $("div#makeMeScrollable").smoothDivScroll({
        manualContinuousScrolling: true,
        autoScrollingMode: "always",
        autoScrollingInterval: 80,
        autoScrollingDirection: "endlessLoopRight",
        autoScrollingStep: 1,
        hotSpotScrolling: false,
        mousewheelScrolling: "",
        touchScrolling: false
    });

});
Ezra Free
  • 808
  • 11
  • 21