diff options
| author | Owen <despito@MacBook-Pro-de-Despito.local> | 2014-07-14 19:06:42 +0300 |
|---|---|---|
| committer | Owen <despito@MacBook-Pro-de-Despito.local> | 2014-07-14 19:06:42 +0300 |
| commit | 335af0bbf19ef4e6454233c9b4d212ee5aaa9d0d (patch) | |
| tree | 7433f0c265acf863db5a6615eab6f601c94e0dad /scripts/ScrollTo.js | |
| parent | 2d98eaaf727834c128fdd2513d43d677d97fe8d7 (diff) | |
Target and adjacent nodes are highlighted when clicked
Background click remove editing boxes and highlights
Deliverables test button adds 140 random tasks and dates
Links between nodes have two colors: blue and green for dependencies
Diffstat (limited to 'scripts/ScrollTo.js')
| -rw-r--r-- | scripts/ScrollTo.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/ScrollTo.js b/scripts/ScrollTo.js new file mode 100644 index 00000000..a015f08c --- /dev/null +++ b/scripts/ScrollTo.js @@ -0,0 +1,17 @@ +$.fn.scrollTo = function( target, options, callback ){ + if(typeof options == 'function' && arguments.length == 2){ callback = options; options = target; } + var settings = $.extend({ + scrollTarget : target, + offsetTop : 50, + duration : 500, + easing : 'swing' + }, options); + return this.each(function(){ + var scrollPane = $(this); + var scrollTarget = (typeof settings.scrollTarget == "number") ? settings.scrollTarget : $(settings.scrollTarget); + var scrollY = (typeof scrollTarget == "number") ? scrollTarget : scrollTarget.offset().top + scrollPane.scrollTop() - parseInt(settings.offsetTop); + scrollPane.animate({scrollTop : scrollY }, parseInt(settings.duration), settings.easing, function(){ + if (typeof callback == 'function') { callback.call(this); } + }); + }); +}
\ No newline at end of file |
