Dezinerfolio

dfSmooth Scroll

Your rating: None Average: 4.1 (323 votes)

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.

  • Simplest to implement
  • One of the smallest Javascript 1024 bytes
  • Cross-Browser compatible
  • Includes the source file too…

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…

AttachmentSizeHitsLast download
dfSmooth Scroll5.66 KB708461 hour 25 min ago

Comments

Anonymous's picture

love you. thanks a lot (from italy)

mastropapaja (not verified)
Tue, 10/11/2011 - 21:33
Anonymous's picture

This is such a nice and easy to use script. Thank you! You have a bunch of cool stuff on your site!

Junior D'haese (not verified)
Thu, 10/06/2011 - 23:11
Anonymous's picture

howdy everyone.As I said, Now i am the following so you may relax now, or not as you see fit. WOW! What is wrong with this guy? Wonderful now I am asking myself concerns. Hope I can answer them.

plaistedzvu (not verified)
Thu, 07/21/2011 - 15:34
Anonymous's picture

hey there blokes, great discussion board you acquired at this point. im new and happy to be here.

plaistedzvu (not verified)
Thu, 07/21/2011 - 12:57
Anonymous's picture

to the previous poster...This site was written 2 years ago. Do you regularly monitor every thing you did 2 years ago ?
He probably wrote it and forgot about it...As you should

Anonymous (not verified)
Mon, 01/17/2011 - 01:58
Anonymous's picture

Does this person respond to ANY of his fucking comments?? wtf?? why have a site where you offer something if you don't keep up on it and take some responsibility....Developers like you should just go away...

Anonymous (not verified)
Thu, 11/11/2010 - 10:41
Anonymous's picture

hi, how can i call the function directly from a button or link, passing in an anchor?

thank!

johny why (not verified)
Thu, 09/30/2010 - 20:39
Anonymous's picture

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.

Joe R (not verified)
Sat, 01/30/2010 - 04:33
Anonymous's picture

You beaut!
Was just racking my brain on that particular conundrum and decided to look at the comments panel. Thanks very much Joe. I think 3000px high screens won't be commonplace for another few years, at least for browsing the web with.
Thanks again.

nrutter2000 (not verified)
Mon, 02/14/2011 - 21:43
ethos2.0's picture

Hi dezignerfolio,

How to use smoothscroll.js with a

Tx a lot.

Sun, 10/25/2009 - 21:23

Post new comment

The content of this field is kept private and will not be shown publicly.