We are again back with another interesting miniature javascript called the “df Smooth Scroll“. This script is also one of the smallest Smooth Scrolling Javascripts after our Simple Accordions.
We always see that we have atleast one image on every post of ours… but for this script we were too confused to go about the image and finally put up the above one (sorry if it pains your eyes cos its motion blurred )
Usage: This script is too simple to understand and use. Nothing but playing with Anchor Tags. Include the Javascript and you are set to smoooooooooth scroll…
| Attachment | Size | Hits | Last download |
|---|---|---|---|
| dfSmooth Scroll | 5.66 KB | 52895 | 3 min 43 sec ago |
Comments
Great script, but it has a problem with scroll height if you use a maximized browser with a height of 1050. I looked into it, and the problem is the way that the motion is calculated when the inner height is greater than the scroll Height minus the distance traveled (which should probably only happen when the scroll distance is very small or the browser is very large). The issue is that the effective equation of (d-a-(h-d)) or (a-h) (where d is the distance to travel, a is the current page position, and h is the scroll height) is useful when the distance is very small, but ends up being a large positive number when the distance is large. I'm not sure of the appropriate solution, but a quick fix is to remove i and the entire second if clause from the scroll(d) function, and just use same equation for all parts where d>a. For an example of this script with the 4 lines removed, look here : http://www.colorado.gov/cms/js/sipaNewSite/scroller.js
Incidentally, if you remove those 4 lines, the page will fail to scroll IF the browser height is in the range of about 3000 pixels. I'm not sure how many of us have 3000p screens, so I figured it's not an issue for a little while. If someone comes up with a better solution, I'm all ears.
Hope this helps anyone who's having the same problem of "Sometimes the page scrolls to the wrong place, even when testing on the same browser version on different machines, or even sometimes on the same machine"
BTW, your captcha is broken.
Hi dezignerfolio,
How to use smoothscroll.js with a
Tx a lot.
Hi dezinerfolio,
How to use smoothscroll.js with a
thanks by advance !
Using dfSmoothScroll on my site:
http://titsiphone.tumblr.com (NSFW)
Works great in safari and on iPhone, but not so great in Firefox on mac.
It consistently scrolls to the wrong anchors.
Anyone got suggestions?
I'm trying to get this to scroll to a specified pixel height (I have a larger-than-window Flash file with SWFFit using coordinates as anchors) so I need to work around dfSmooth Scroll's built-in anchor handling. What should I call to scroll to a specified height?
Awesome , great work
but i have one question ,
How can i change it to use ID`s instead of name ?
Hi guys,
The scroller works perfectly, I'm using it with Wordpress, but the dynamic links doens't work anymore :/
( like > http://youyouyou/wordpress/?p=558#more-558
Any Idea ?
Thx.
Sorry for my crappy English :/
CANNOT get the scroll speed slower. Will accept speed=10 or speed=100 only. I would like it more around 50...any help that works? Thanks!
Nobody has an answer to this question...
I am not an idiot, but i CANNOT get the scroll speed to slow down. It accepts either 10 or 100, but nothing in between. Can anyone tell me how to accomplish this easily...? Thanks!
Post new comment