From 335af0bbf19ef4e6454233c9b4d212ee5aaa9d0d Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 14 Jul 2014 19:06:42 +0300 Subject: 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 --- scripts/ScrollTo.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/ScrollTo.js (limited to 'scripts/ScrollTo.js') 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 -- cgit v1.3.1