jQuery Smooth Scroll - Version 1.2.0

Version Description

Download this release

Release Info

Developer BlogSynthesis
Plugin Icon 128x128 jQuery Smooth Scroll
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.5 to 1.2.0

Files changed (4) hide show
  1. js/jss-script.js +1 -1
  2. js/jss-script.min.js +1 -1
  3. plugin.php +1 -1
  4. readme.txt +1 -1
js/jss-script.js CHANGED
@@ -1 +1 @@
1
- /*
2
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
*
4
* Uses the built in easing capabilities added In jQuery 1.1
5
* to offer multiple easing options
6
*
7
* TERMS OF USE - jQuery Easing
8
*
9
* Open source under the BSD License.
10
*
11
* Copyright © 2008 George McGinley Smith
12
* All rights reserved.
13
*
14
* Redistribution and use in source and binary forms, with or without modification,
15
* are permitted provided that the following conditions are met:
16
*
17
* Redistributions of source code must retain the above copyright notice, this list of
18
* conditions and the following disclaimer.
19
* Redistributions in binary form must reproduce the above copyright notice, this list
20
* of conditions and the following disclaimer in the documentation and/or other materials
21
* provided with the distribution.
22
*
23
* Neither the name of the author nor the names of contributors may be used to endorse
24
* or promote products derived from this software without specific prior written permission.
25
*
26
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
* OF THE POSSIBILITY OF SUCH DAMAGE.
35
*
36
*
37
* TERMS OF USE - EASING EQUATIONS
38
*
39
* Open source under the BSD License.
40
*
41
* Copyright © 2001 Robert Penner
42
* All rights reserved.
43
*
44
* Redistribution and use in source and binary forms, with or without modification,
45
* are permitted provided that the following conditions are met:
46
*
47
* Redistributions of source code must retain the above copyright notice, this list of
48
* conditions and the following disclaimer.
49
* Redistributions in binary form must reproduce the above copyright notice, this list
50
* of conditions and the following disclaimer in the documentation and/or other materials
51
* provided with the distribution.
52
*
53
* Neither the name of the author nor the names of contributors may be used to endorse
54
* or promote products derived from this software without specific prior written permission.
55
*
56
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
57
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
58
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
59
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
60
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
61
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
62
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
63
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
64
* OF THE POSSIBILITY OF SUCH DAMAGE.
65
*
66
*/
67
});
68
69
/*
70
* jQuery PlusAnchor 1.0.7.2
71
* By Jamy Golden
72
* http://css-plus.com
73
*
74
* Copyright 2011, Jamy Golden
75
* Free to use under the MIT license.
76
* http://www.opensource.org/licenses/mit-license.php
77
*/
78
79
jQuery(document).ready(function($) {
80
81
$.plusAnchor = function(el, options){
82
// To avoid scope issues, use 'base' instead of 'this'
83
// to reference this class from internal events and functions.
84
var base = this;
85
// Access to jQuery and DOM versions of element
86
base.el = el;
87
base.$el = $(el);
88
base.$el.data('plusAnchor', base); // Add a reverse reference to the DOM object
89
base.scrollEl = 'body, html';
90
base.initHash = window.location.hash;
91
base.offsetTop = function( ) {
92
return $('html').offset().top;
93
}; // base.offsetTop()
94
base.detectScrollEl = function() {
95
var curPos = base.offsetTop(),
96
newPos = 0;
97
$('body').animate({
98
scrollTop: curPos * -1 + 1
99
}, 0, function() {
100
newPos = base.offsetTop();
101
});
102
103
// IE fails this test but scrolls on 'html', so the fallback should be html
104
newPos < curPos && newPos !== 0 ? base.scrollEl = 'body' : base.scrollEl = 'html';
105
}; // base.detectScrollEl()
106
base.init = function(){
107
base.options = $.extend({}, $.plusAnchor.defaults, options);
108
base.detectScrollEl();
109
// onInit callback
110
if ( base.options.onInit && typeof( base.options.onInit ) == 'function' ) base.options.onInit( base );
111
// End onInit callback
112
base.$el.find('a[href^="#"]').click(function( e ) {
113
114
e.preventDefault();
115
116
var $this = $(this);
117
href = $this.attr('href'),
118
$name = $('a[name="' + $(this).attr('href').substring(1) + '"]');
119
120
if ( $(href).length ){
121
// onSlide callback
122
if ( base.options.onSlide && typeof( base.options.onSlide ) == 'function' ) base.options.onSlide( base );
123
// End onSlide callback
124
$(base.scrollEl).animate({
125
scrollTop: $(href).offset().top
126
}, base.options.speed, base.options.easing);
127
} else if ( $name.length ){
128
// onSlide callback
129
if ( base.options.onSlide && typeof( base.options.onSlide ) == 'function' ) base.options.onSlide( base );
130
// End onSlide callback
131
$(base.scrollEl).animate({
132
scrollTop: $name.offset().top
133
}, base.options.speed, base.options.easing);
134
}
135
});
136
}; // base.init()
137
// Run initializer
138
base.init();
139
};
140
$.plusAnchor.defaults ={
141
easing: 'swing', // Anything other than "swing" or "linear" requires the easing.js plugin
142
speed: 1000, // The speed, in miliseconds, it takes to complete a slide
143
onInit: null, // Callback function on plugin initialize
144
onSlide: null // Callback function that runs just before the page starts animating
145
};
146
$.fn.plusAnchor = function(options){
147
return this.each(function(){
148
(new $.plusAnchor(this, options));
149
});
150
};
151
$(document).ready(function(){
152
function filterPath(string) {
153
return string
154
.replace(/^\//,'')
155
.replace(/(index|default).[a-zA-Z]{3,4}#x2F;,'')
156
.replace(/\/#x2F;,'');
157
}
158
var locationPath = filterPath(location.pathname);
159
var scrollElem = scrollableElement('html', 'body');
160
161
$('a[href*=#]').each(function() {
162
var thisPath = filterPath(this.pathname) || locationPath;
163
if ( locationPath == thisPath
164
&& (location.hostname == this.hostname || !this.hostname)
165
&& this.hash.replace(/#/,'') ) {
166
var $target = $(this.hash), target = this.hash;
167
if (target) {
168
var targetOffset = $target.offset().top;
169
$(this).click(function(event) {
170
event.preventDefault();
171
$(scrollElem).animate({scrollTop: targetOffset}, 400, function() {
172
location.hash = target;
173
});
174
});
175
}
176
}
177
});
178
179
// use the first element that is "scrollable"
180
function scrollableElement(els) {
181
for (var i = 0, argLength = arguments.length; i <argLength; i++) {
182
var el = arguments[i],
183
$scrollElement = $(el);
184
if ($scrollElement.scrollTop()> 0) {
185
return el;
186
} else {
187
$scrollElement.scrollTop(1);
188
var isScrollable = $scrollElement.scrollTop()> 0;
189
$scrollElement.scrollTop(0);
190
if (isScrollable) {
191
return el;
192
}
193
}
194
}
195
return [];
196
}
197
1
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
2
*
3
* Uses the built in easing capabilities added In jQuery 1.1
4
* to offer multiple easing options
5
*
6
* TERMS OF USE - jQuery Easing
7
*
8
* Open source under the BSD License.
9
*
10
* Copyright © 2008 George McGinley Smith
11
* All rights reserved.
12
*
13
* Redistribution and use in source and binary forms, with or without modification,
14
* are permitted provided that the following conditions are met:
15
*
16
* Redistributions of source code must retain the above copyright notice, this list of
17
* conditions and the following disclaimer.
18
* Redistributions in binary form must reproduce the above copyright notice, this list
19
* of conditions and the following disclaimer in the documentation and/or other materials
20
* provided with the distribution.
21
*
22
* Neither the name of the author nor the names of contributors may be used to endorse
23
* or promote products derived from this software without specific prior written permission.
24
*
25
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
26
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
30
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
31
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33
* OF THE POSSIBILITY OF SUCH DAMAGE.
34
*
35
*
36
* TERMS OF USE - EASING EQUATIONS
37
*
38
* Open source under the BSD License.
39
*
40
* Copyright © 2001 Robert Penner
41
* All rights reserved.
42
*
43
* Redistribution and use in source and binary forms, with or without modification,
44
* are permitted provided that the following conditions are met:
45
*
46
* Redistributions of source code must retain the above copyright notice, this list of
47
* conditions and the following disclaimer.
48
* Redistributions in binary form must reproduce the above copyright notice, this list
49
* of conditions and the following disclaimer in the documentation and/or other materials
50
* provided with the distribution.
51
*
52
* Neither the name of the author nor the names of contributors may be used to endorse
53
* or promote products derived from this software without specific prior written permission.
54
*
55
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
56
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
57
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
58
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
59
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
60
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
61
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
62
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
63
* OF THE POSSIBILITY OF SUCH DAMAGE.
64
*
65
*/
66
});
67
68
/*
69
* jQuery PlusAnchor 1.0.7.2
70
* By Jamy Golden
71
* http://css-plus.com
72
*
73
* Copyright 2011, Jamy Golden
74
* Free to use under the MIT license.
75
* http://www.opensource.org/licenses/mit-license.php
76
*/
77
78
jQuery(document).ready(function($) {
79
80
$.plusAnchor = function(el, options){
81
// To avoid scope issues, use 'base' instead of 'this'
82
// to reference this class from internal events and functions.
83
var base = this;
84
// Access to jQuery and DOM versions of element
85
base.el = el;
86
base.$el = $(el);
87
base.$el.data('plusAnchor', base); // Add a reverse reference to the DOM object
88
base.scrollEl = 'body, html';
89
base.initHash = window.location.hash;
90
base.offsetTop = function( ) {
91
return $('html').offset().top;
92
}; // base.offsetTop()
93
base.detectScrollEl = function() {
94
var curPos = base.offsetTop(),
95
newPos = 0;
96
$('body').animate({
97
scrollTop: curPos * -1 + 1
98
}, 0, function() {
99
newPos = base.offsetTop();
100
});
101
102
// IE fails this test but scrolls on 'html', so the fallback should be html
103
newPos < curPos && newPos !== 0 ? base.scrollEl = 'body' : base.scrollEl = 'html';
104
}; // base.detectScrollEl()
105
base.init = function(){
106
base.options = $.extend({}, $.plusAnchor.defaults, options);
107
base.detectScrollEl();
108
// onInit callback
109
if ( base.options.onInit && typeof( base.options.onInit ) == 'function' ) base.options.onInit( base );
110
// End onInit callback
111
base.$el.find('a[href^="#"]').click(function( e ) {
112
113
e.preventDefault();
114
115
var $this = $(this);
116
href = $this.attr('href'),
117
$name = $('a[name="' + $(this).attr('href').substring(1) + '"]');
118
119
if ( $(href).length ){
120
// onSlide callback
121
if ( base.options.onSlide && typeof( base.options.onSlide ) == 'function' ) base.options.onSlide( base );
122
// End onSlide callback
123
$(base.scrollEl).animate({
124
scrollTop: $(href).offset().top
125
}, base.options.speed, base.options.easing);
126
} else if ( $name.length ){
127
// onSlide callback
128
if ( base.options.onSlide && typeof( base.options.onSlide ) == 'function' ) base.options.onSlide( base );
129
// End onSlide callback
130
$(base.scrollEl).animate({
131
scrollTop: $name.offset().top
132
}, base.options.speed, base.options.easing);
133
}
134
});
135
}; // base.init()
136
// Run initializer
137
base.init();
138
};
139
$.plusAnchor.defaults ={
140
easing: 'swing', // Anything other than "swing" or "linear" requires the easing.js plugin
141
speed: 1000, // The speed, in miliseconds, it takes to complete a slide
142
onInit: null, // Callback function on plugin initialize
143
onSlide: null // Callback function that runs just before the page starts animating
144
};
145
$.fn.plusAnchor = function(options){
146
return this.each(function(){
147
(new $.plusAnchor(this, options));
148
});
149
};
150
$(document).ready(function(){
151
+ jQuery.noConflict();
152
function filterPath(string) {
153
return string
154
.replace(/^\//,'')
155
.replace(/(index|default).[a-zA-Z]{3,4}#x2F;,'')
156
.replace(/\/#x2F;,'');
157
}
158
var locationPath = filterPath(location.pathname);
159
var scrollElem = scrollableElement('html', 'body');
160
161
$('a[href*=#]').each(function() {
162
var thisPath = filterPath(this.pathname) || locationPath;
163
if ( locationPath == thisPath
164
&& (location.hostname == this.hostname || !this.hostname)
165
&& this.hash.replace(/#/,'') ) {
166
var $target = $(this.hash), target = this.hash;
167
if (target) {
168
var targetOffset = $target.offset().top;
169
$(this).click(function(event) {
170
event.preventDefault();
171
$(scrollElem).animate({scrollTop: targetOffset}, 400, function() {
172
location.hash = target;
173
});
174
});
175
}
176
}
177
});
178
179
// use the first element that is "scrollable"
180
function scrollableElement(els) {
181
for (var i = 0, argLength = arguments.length; i <argLength; i++) {
182
var el = arguments[i],
183
$scrollElement = $(el);
184
if ($scrollElement.scrollTop()> 0) {
185
return el;
186
} else {
187
$scrollElement.scrollTop(1);
188
var isScrollable = $scrollElement.scrollTop()> 0;
189
$scrollElement.scrollTop(0);
190
if (isScrollable) {
191
return el;
192
}
193
}
194
}
195
return [];
196
}
197
js/jss-script.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function($){jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}})});jQuery(document).ready(function($){(function($){$.plusAnchor=function(el,options){var base=this;base.el=el;base.$el=$(el);base.$el.data('plusAnchor',base);base.scrollEl='body, html';base.initHash=window.location.hash;base.offsetTop=function(){return $('html').offset().top};base.detectScrollEl=function(){var curPos=base.offsetTop(),newPos=0;$('body').animate({scrollTop:curPos*-1+1},0,function(){newPos=base.offsetTop()});newPos<curPos&&newPos!==0?base.scrollEl='body':base.scrollEl='html'};base.init=function(){base.options=$.extend({},$.plusAnchor.defaults,options);base.detectScrollEl();if(base.options.onInit&&typeof(base.options.onInit)=='function')base.options.onInit(base);base.$el.find('a[href^="#"]').click(function(e){e.preventDefault();var $this=$(this);href=$this.attr('href'),$name=$('a[name="'+$(this).attr('href').substring(1)+'"]');if($(href).length){if(base.options.onSlide&&typeof(base.options.onSlide)=='function')base.options.onSlide(base);$(base.scrollEl).animate({scrollTop:$(href).offset().top},base.options.speed,base.options.easing)}else if($name.length){if(base.options.onSlide&&typeof(base.options.onSlide)=='function')base.options.onSlide(base);$(base.scrollEl).animate({scrollTop:$name.offset().top},base.options.speed,base.options.easing)}})};base.init()};$.plusAnchor.defaults={easing:'swing',speed:1000,onInit:null,onSlide:null};$.fn.plusAnchor=function(options){return this.each(function(){(new $.plusAnchor(this,options))})}})(jQuery);$(document).ready(function(){$(document).plusAnchor()})});jQuery.noConflict();jQuery(function($){var upperLimit=100;var scrollElem=$('a#scroll-to-top');var scrollSpeed=500;scrollElem.hide();$(window).scroll(function(){var scrollTop=$(document).scrollTop();if(scrollTop>upperLimit){$(scrollElem).stop().fadeTo(300,1)}else{$(scrollElem).stop().fadeTo(300,0)}});$(scrollElem).click(function(){$('html, body').animate({scrollTop:0},scrollSpeed);return false})});
1
+ jQuery.noConflict();jQuery(function(d){var a=100;var c=d("a#scroll-to-top");var b=500;c.hide();d(window).scroll(function(){var e=d(document).scrollTop();if(e>a){d(c).stop().fadeTo(300,1);}else{d(c).stop().fadeTo(300,0);}});d(c).click(function(){d("html, body").animate({scrollTop:0},b);return false;});});
plugin.php CHANGED
@@ -1 +1 @@
1
- <?php
2
Copyright 2012 Anand Kumar (blogsynthesis.com)
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License, version 2, as
5
published by the Free Software Foundation.
6
This program is distributed in the hope that it will be useful,
7
but WITHOUT ANY WARRANTY; without even the implied warranty of
8
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
GNU General Public License for more details.
10
You should have received a copy of the GNU General Public License
11
along with this program; if not, write to the Free Software
12
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
13
14
Kindly check README.txt for more details about the plugin.
15
16
// Load JavaScript and stylesheets
17
$this->register_scripts_and_styles();
18
19
20
21
22
23
Copyright 2012 Anand Kumar (blogsynthesis.com)
24
This program is free software; you can redistribute it and/or modify
25
it under the terms of the GNU General Public License, version 2, as
26
published by the Free Software Foundation.
27
This program is distributed in the hope that it will be useful,
28
but WITHOUT ANY WARRANTY; without even the implied warranty of
29
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
GNU General Public License for more details.
31
You should have received a copy of the GNU General Public License
32
along with this program; if not, write to the Free Software
33
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34
35
Kindly check README.txt for more details about the plugin.
36
37
// Load JavaScript and stylesheets
38
$this->register_scripts_and_styles();
39
40
41
42
43
1
Copyright 2012 Anand Kumar (blogsynthesis.com)
2
This program is free software; you can redistribute it and/or modify
3
it under the terms of the GNU General Public License, version 2, as
4
published by the Free Software Foundation.
5
This program is distributed in the hope that it will be useful,
6
but WITHOUT ANY WARRANTY; without even the implied warranty of
7
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8
GNU General Public License for more details.
9
You should have received a copy of the GNU General Public License
10
along with this program; if not, write to the Free Software
11
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
12
13
Kindly check README.txt for more details about the plugin.
14
15
// Load JavaScript and stylesheets
16
$this->register_scripts_and_styles();
17
18
19
20
21
22
+ <?php
23
Copyright 2012 Anand Kumar (blogsynthesis.com)
24
This program is free software; you can redistribute it and/or modify
25
it under the terms of the GNU General Public License, version 2, as
26
published by the Free Software Foundation.
27
This program is distributed in the hope that it will be useful,
28
but WITHOUT ANY WARRANTY; without even the implied warranty of
29
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
GNU General Public License for more details.
31
You should have received a copy of the GNU General Public License
32
along with this program; if not, write to the Free Software
33
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34
35
Kindly check README.txt for more details about the plugin.
36
37
// Load JavaScript and stylesheets
38
$this->register_scripts_and_styles();
39
40
41
42
43
readme.txt CHANGED
@@ -1 +1 @@
1
- === jQuery Smooth Scroll ===
1
+ === jQuery Smooth Scroll ===