From d50c57c6bd381cd08af98f767a4ebf7b4e5c7f59 Mon Sep 17 00:00:00 2001 From: Sparks Date: Wed, 6 Nov 2013 12:14:40 +0100 Subject: [PATCH] it is now possible to change the style of the line into parameters --- script/jquery.scrollpath.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/script/jquery.scrollpath.js b/script/jquery.scrollpath.js index 9bda986..dd992b4 100644 --- a/script/jquery.scrollpath.js +++ b/script/jquery.scrollpath.js @@ -45,7 +45,15 @@ settings = { wrapAround: false, drawPath: false, - scrollBar: true + scrollBar: true, + lineStyle: { + shadowBlur: 15, + shadowColor: "black", + strokeStyle: "white", + lineJoin: "round", + lineCap: "round", + lineWidth: 10 + } }, methods = { @@ -53,7 +61,7 @@ init: function( options ) { if ( this.length > 1 || isInitialized ) $.error( "jQuery.scrollPath can only be initialized on *one* element *once*" ); - $.extend( settings, options ); + $.extend(true, settings, options); isInitialized = true; element = this; pathList = pathObject.getPath(); @@ -388,12 +396,7 @@ function drawCanvasPath( context, path ) { var i = 0; - context.shadowBlur = 15; - context.shadowColor = "black"; - context.strokeStyle = "white"; - context.lineJoin = "round"; - context.lineCap = "round"; - context.lineWidth = 10; + $.extend(true, context, settings.lineStyle); for( ; i < path.length; i++ ) { context[ path[ i ].method ].apply( context, path[ i ].args );