Skip to content

Commit abb6711

Browse files
author
Karl Swedberg
committed
non-code-related updates. added license info, change jquery reference to point to code.jquery.com instead of google cdn.
1 parent 2e67030 commit abb6711

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
width: 200px;
1010
}
1111
</style>
12-
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>
12+
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script>
1313
<script src="../jquery.smooth-scroll.js" type="text/javascript"></script>
1414
<script type="text/javascript">
1515
$(document).ready(function() {

jquery.smooth-scroll.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
/*
2+
* jQuery Smooth Scroll plugin
3+
* Version 1.1 (March 25, 2010)
4+
* @requires jQuery v1.3+
5+
*
6+
* Dual licensed under the MIT and GPL licenses (just like jQuery):
7+
* http://www.opensource.org/licenses/mit-license.php
8+
* http://www.gnu.org/licenses/gpl.html
9+
*
10+
*/
11+
12+
113
(function($) {
2-
// Animated Scrolling for Same-Page Links
3-
// @see http://www.learningjquery.com/2007/10/improved-animated-scrolling-script-for-same-page-links
414

515
var version = '1.1';
616

@@ -90,7 +100,7 @@ $.fn.smoothScroll.defaults = {
90100
excludeWithin:[],
91101
offset: 0,
92102
scrollTarget: null, // only use if you want to override default behavior
93-
afterScroll: null, // function to be called after window is scrolled
103+
afterScroll: null, // function to be called after window is scrolled. "this" is the triggering element
94104
easing: 'swing',
95105
speed: 400
96106
};

readme.textile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ h2. Features
88
* Exclude links if they are within a containing element: $('#container a').smoothScroll({excludeWithin: ['.container2']});
99
* Exclude links if they match certain conditions: $('a').smoothScroll({exclude: ['.rough','#chunky']});
1010
* Adjust where the scrolling stops: $('.backtotop').smoothScroll({offset: -100});
11+
* Add a callback function that is triggered after the scroll is complete: $('a').smoothScroll({afterScroll: function() { window.location.hash = this.hash; }});
1112

1213
h2. Flaws
1314

0 commit comments

Comments
 (0)