Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css oddity #9

Open
Blindeman opened this issue Jun 11, 2012 · 7 comments
Open

css oddity #9

Blindeman opened this issue Jun 11, 2012 · 7 comments
Assignees

Comments

@Blindeman
Copy link

Wonderful piece of code, just one thing I seem to run into:
if I give the body a margin of 0 or 0px and I have autoScrollingMode set to onStart, in Chrome and Safari the div starts scrolling very quickly right to left, regardless of default settings or added settings for autoScrollingDirection, autoScrollingStep or autoScrollingInterval. If I leave the body margins to default or set them to 1px, or anything other than 0, it immediately resumes working as intended: a smooth left to right scroll.
I've resolved it with a workaround but thought you might want to know, in case this isn't intended behavior.
Thanks!

@tkahn
Copy link
Owner

tkahn commented Jul 29, 2012

Hi!

Do you have a demo page with this behavior that I could take a look at?
I'm also curious about your workaround.

/Thomas

@Blindeman
Copy link
Author

Hello Thomas,
the workaround is nothing more than sticky tape, sorry:

<style>
  body { margin: 1px; overflow: hidden;}
</style>
<noscript>
  <style>
    body { overflow: auto;}
  </style>
</noscript>

But it works for what I wanted.

Here is the one with the odd behavior in chrome and safari: http://please-transfer.us/juni2012/indexNO.html
Here is one with the workaround: http://please-transfer.us/juni2012/indexYES.html

The odd behavior is only apparent on first load, once I mouse over, it starts behaving more normally...
If you have questions or suggestions, I hope you'll let me know.
Naomi

@tkahn
Copy link
Owner

tkahn commented Jul 30, 2012

Hi!

It seems like it's the combination of having autoscrolling active, manualContinuosScrolling set to true and margin/padding set to zero that does it. Remove any one of these three factors and it will work fine. So if you try setting manualContinuousScrolling to false the problem will not occur. The same thing if you add 1 pixel margin/padding. And of course if you disable the autoscrolling, it will not scroll automatically at all and you won't experience this problem.

Interesting!
My experience tells me that this is the kind of problem that is not solved in ten seconds since I need to prod and poke the plugin to see exactly what's going on, in which order things are executed and which values it's working with. Well - I'll see what I can do. :-)

Thanks for bringing this strange bug to my attention.

/Thomas

@ghost ghost assigned tkahn Jul 30, 2012
@tkahn
Copy link
Owner

tkahn commented Jul 30, 2012

Okay, now I've done some testing to see what is going on and it's very puzzling.

What happens (in Safari and Chrome) is that the autoscrolling interval manages to run for 6-9 times (varies randomly, probably because of variations in execution time). If you have a fast eye you can see it as a small movement directly after you reload the page. But then this autoscrolling interval is interrupted as the mouseover event of the left scrolling hot spot is triggered(!) And here's the weird part: the mouse pointer is nowhere near the left scrolling hot spot! The event is triggered even though it should't.

So the rapid scrolling you are seeing occurs because of what seems to be a browser bug or a combination of browser and jQuery bug. I can't see anything in the Smooth Div Scroll code that would cause this. This also explains why the problem stops as soon as you move the mouse pointer into the content area of the browser window. When you do that the mouseout event for the left hot spot is triggered and the manic scrolling stops.

If anyone knows more about this or has read something about a bug like this, please let me know.

@Blindeman
Copy link
Author

That is very interesting and now that you mentioned it, I did see the the small movement. Could it be something that finishes loading and causes the trouble?
I haven't heard of anything like this before but I will poke around a little for known webkit/jquery bugs and if I come across something I'll definitely let you know.
I'd love to figure this one out, feels a bit like a ghost in the webkit. :-)

@tkahn
Copy link
Owner

tkahn commented Aug 2, 2012

I wouldn't be surprised if there is something in webkit in combination with Smooth Div Scroll that causes this. The thing with Smooth Div Scroll is that it uses jQuery/javascript in a way that is not that common. Therefore there is a high probability that the things that Smooth Div Scroll does has not been tested previously.

@kopmanis
Copy link

I'm seeing a bug like this in Safari and Chrome (current versions) as of this writing. Opera works fine. My symptoms: The items in the display are displayed once, and then stop. I have the following smoothDivScroll call:

$("#scrollingText").smoothDivScroll({
    ajaxContentURL: "scroll_text.php",
            autoScrollDirection: "endlessloopright",
            autoScrollingMode: "always"
            });

Notably, this doesn't happen if I used the fixed "garbage" items in #scrollingText, but only happens when I AJAX-load the content. scroll_text.php is utterly stupid (make MySQL call and print each entry between paragraph tags), and even sets its MIME type correctly (it grumped about that for a bit until I explicitly set it).

Are there any hotspot settings to be made that will avoid this WebKit behavior?

(oh yeah, SmoothDivScroll is a wonderful little plugin! Thanks, tkahn!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants