Version Description
- Minor code tweaks
- Minified scripts
Download this release
Release Info
Developer | malihu |
Plugin | Page scroll to id |
Version | 1.5.1 |
Comparing to | |
See all releases |
Code changes from version 1.5.0 to 1.5.1
- js/jquery.malihu.PageScroll2id.js +1 -568
- malihu-pagescroll2id.php +5 -5
- readme.txt +7 -3
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
js/jquery.malihu.PageScroll2id.js
CHANGED
@@ -1,568 +1 @@
|
|
1 |
-
/*
|
2 |
-
== Page scroll to id ==
|
3 |
-
Version: 1.5.0
|
4 |
-
Plugin URI: http://manos.malihu.gr/animate-page-to-id-with-jquery/
|
5 |
-
Author: malihu
|
6 |
-
Author URI: http://manos.malihu.gr
|
7 |
-
*/
|
8 |
-
|
9 |
-
/*
|
10 |
-
This program is free software: you can redistribute it and/or modify
|
11 |
-
it under the terms of the GNU Lesser General Public License as published by
|
12 |
-
the Free Software Foundation, either version 3 of the License, or
|
13 |
-
any later version.
|
14 |
-
|
15 |
-
This program is distributed in the hope that it will be useful,
|
16 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
-
GNU Lesser General Public License for more details.
|
19 |
-
|
20 |
-
You should have received a copy of the GNU Lesser General Public License
|
21 |
-
along with this program. If not, see http://www.gnu.org/licenses/lgpl.html.
|
22 |
-
*/
|
23 |
-
|
24 |
-
;(function($,window,document,undefined){
|
25 |
-
|
26 |
-
/* plugin namespace, prefix, default selector(s) */
|
27 |
-
|
28 |
-
var pluginNS="mPageScroll2id",
|
29 |
-
pluginPfx="mPS2id",
|
30 |
-
defaultSelector=".m_PageScroll2id,a[rel~='m_PageScroll2id'],.page-scroll-to-id,a[rel~='page-scroll-to-id']",
|
31 |
-
|
32 |
-
/* default options */
|
33 |
-
|
34 |
-
defaults={
|
35 |
-
/* scroll animation speed in milliseconds: Integer */
|
36 |
-
scrollSpeed:1300,
|
37 |
-
/* auto-adjust animation speed (according to target element position and window scroll): Boolean */
|
38 |
-
autoScrollSpeed:true,
|
39 |
-
/* scroll animation easing when page is idle: String */
|
40 |
-
scrollEasing:"easeInOutExpo",
|
41 |
-
/* scroll animation easing while page is scrolling: String */
|
42 |
-
scrollingEasing:"easeInOutCirc",
|
43 |
-
/* end of page "smooth scrolling" (auto-adjust the scroll-to position when bottom elements are too short): Boolean */
|
44 |
-
pageEndSmoothScroll:true,
|
45 |
-
/*
|
46 |
-
page layout defines scrolling direction: String
|
47 |
-
values: "vertical", "horizontal", "auto"
|
48 |
-
*/
|
49 |
-
layout:"vertical",
|
50 |
-
/* extra space in pixels for the target element position: Integer */
|
51 |
-
offset:0,
|
52 |
-
/* highlight the main/default selectors or insert a different set: Boolean, String */
|
53 |
-
highlightSelector:false,
|
54 |
-
/* class of the clicked element: String */
|
55 |
-
clickedClass:pluginPfx+"-clicked",
|
56 |
-
/* class of the current target element: String */
|
57 |
-
targetClass:pluginPfx+"-target",
|
58 |
-
/* class of the highlighted element: String */
|
59 |
-
highlightClass:pluginPfx+"-highlight",
|
60 |
-
/* force a single highlighted element each time: Boolean */
|
61 |
-
forceSingleHighlight:false,
|
62 |
-
/* enable/disable click events for all selectors */
|
63 |
-
clickEvents:true,
|
64 |
-
/* user callback functions: fn */
|
65 |
-
onStart:function(){},
|
66 |
-
onComplete:function(){},
|
67 |
-
/* enable/disable the default selector: Boolean */
|
68 |
-
defaultSelector:false
|
69 |
-
},
|
70 |
-
|
71 |
-
/* vars, constants */
|
72 |
-
|
73 |
-
selector,opt,_init,_trigger,_clicked,_target,_to,_axis,_offset,
|
74 |
-
|
75 |
-
/*
|
76 |
-
---------------
|
77 |
-
methods
|
78 |
-
---------------
|
79 |
-
*/
|
80 |
-
|
81 |
-
methods={
|
82 |
-
|
83 |
-
/* plugin initialization method */
|
84 |
-
|
85 |
-
init:function(options){
|
86 |
-
|
87 |
-
/* extend options, store each option in jquery data */
|
88 |
-
|
89 |
-
var options=$.extend(true,{},defaults,options);
|
90 |
-
|
91 |
-
$(document).data(pluginPfx,options);
|
92 |
-
opt=$(document).data(pluginPfx);
|
93 |
-
|
94 |
-
/* set default selector */
|
95 |
-
|
96 |
-
selector=(!selector) ? this.selector : selector+","+this.selector;
|
97 |
-
|
98 |
-
if(opt.defaultSelector){
|
99 |
-
if(typeof $(selector)!=="object" || $(selector).length===0){
|
100 |
-
selector=defaultSelector;
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
/* plugin events */
|
105 |
-
|
106 |
-
if(opt.clickEvents){
|
107 |
-
$(document)
|
108 |
-
|
109 |
-
.undelegate("."+pluginPfx)
|
110 |
-
|
111 |
-
.delegate(selector,"click."+pluginPfx,function(e){
|
112 |
-
var $this=$(this),
|
113 |
-
href=$this.attr("href"),
|
114 |
-
hrefProp=$this.prop("href");
|
115 |
-
if(href && href.indexOf("#/")!==-1){
|
116 |
-
return;
|
117 |
-
}
|
118 |
-
functions._reset.call(null);
|
119 |
-
if(functions._isValid.call(null,href,hrefProp) && functions._findTarget.call(null,href)){
|
120 |
-
e.preventDefault();
|
121 |
-
_trigger="selector";
|
122 |
-
_clicked=$this;
|
123 |
-
functions._setClasses.call(null,true);
|
124 |
-
functions._scrollTo.call(null);
|
125 |
-
}
|
126 |
-
});
|
127 |
-
}
|
128 |
-
|
129 |
-
$(window)
|
130 |
-
|
131 |
-
.unbind("."+pluginPfx)
|
132 |
-
|
133 |
-
.bind("scroll."+pluginPfx+" resize."+pluginPfx,function(){
|
134 |
-
var targets=$("._"+pluginPfx+"-t");
|
135 |
-
targets.each(function(){
|
136 |
-
var t=$(this),id=t.attr("id"),
|
137 |
-
h=functions._findHighlight.call(null,id);
|
138 |
-
functions._setClasses.call(null,false,t,h);
|
139 |
-
});
|
140 |
-
});
|
141 |
-
|
142 |
-
/* plugin has initialized */
|
143 |
-
|
144 |
-
_init=true;
|
145 |
-
|
146 |
-
/* setup selectors, target elements, basic plugin classes etc. */
|
147 |
-
|
148 |
-
functions._setup.call(null);
|
149 |
-
},
|
150 |
-
|
151 |
-
/* scrollTo method */
|
152 |
-
|
153 |
-
scrollTo:function(id,options){
|
154 |
-
if(id && typeof id!=="undefined"){
|
155 |
-
functions._isInit.call(null);
|
156 |
-
var defaults={
|
157 |
-
layout:opt.layout,
|
158 |
-
offset:opt.offset,
|
159 |
-
clicked:false
|
160 |
-
},
|
161 |
-
options=$.extend(true,{},defaults,options);
|
162 |
-
functions._reset.call(null);
|
163 |
-
_axis=options.layout;
|
164 |
-
_offset=options.offset;
|
165 |
-
id=(id.indexOf("#")!==-1) ? id : "#"+id;
|
166 |
-
if(functions._isValid.call(null,id) && functions._findTarget.call(null,id)){
|
167 |
-
_trigger="scrollTo";
|
168 |
-
_clicked=options.clicked;
|
169 |
-
if(_clicked){
|
170 |
-
functions._setClasses.call(null,true);
|
171 |
-
}
|
172 |
-
functions._scrollTo.call(null);
|
173 |
-
}
|
174 |
-
}
|
175 |
-
},
|
176 |
-
|
177 |
-
/* destroy method */
|
178 |
-
|
179 |
-
destroy:function(){
|
180 |
-
$(window).unbind("."+pluginPfx);
|
181 |
-
$(document).undelegate("."+pluginPfx).removeData(pluginPfx);
|
182 |
-
$("."+opt.clickedClass).removeClass(opt.clickedClass);
|
183 |
-
$("."+opt.targetClass).removeClass(opt.targetClass);
|
184 |
-
$("."+opt.highlightClass).removeClass(opt.highlightClass);
|
185 |
-
$("._"+pluginPfx+"-t").removeData(pluginPfx).removeClass("_"+pluginPfx+"-t");
|
186 |
-
$("._"+pluginPfx+"-h").removeClass("_"+pluginPfx+"-h");
|
187 |
-
}
|
188 |
-
},
|
189 |
-
|
190 |
-
/*
|
191 |
-
---------------
|
192 |
-
functions
|
193 |
-
---------------
|
194 |
-
*/
|
195 |
-
|
196 |
-
functions={
|
197 |
-
|
198 |
-
/* checks if href attribute is valid */
|
199 |
-
|
200 |
-
_isValid:function(href,hrefProp){
|
201 |
-
if(!href){
|
202 |
-
return;
|
203 |
-
}
|
204 |
-
hrefProp=(!hrefProp) ? href : hrefProp;
|
205 |
-
var str=(hrefProp.indexOf("#/")!==-1) ? hrefProp.split("#/")[0] : hrefProp.split("#")[0],
|
206 |
-
loc=window.location.toString().split("#")[0];
|
207 |
-
return href!=="#" && href.indexOf("#")!==-1 && (str==="" || str===loc);
|
208 |
-
},
|
209 |
-
|
210 |
-
/* setup selectors, target elements, basic plugin classes etc. */
|
211 |
-
|
212 |
-
_setup:function(){
|
213 |
-
var el=(opt.highlightSelector && opt.highlightSelector!=="") ? opt.highlightSelector : selector,i=1;
|
214 |
-
return $(el).each(function(){
|
215 |
-
var $this=$(this),href=$this.attr("href"),hrefProp=$this.prop("href");
|
216 |
-
if(functions._isValid.call(null,href,hrefProp)){
|
217 |
-
var id=(href.indexOf("#/")!==-1) ? href.split("#/")[1] : href.split("#")[1],t=$("#"+id);
|
218 |
-
if(t.length>0){
|
219 |
-
if(!t.hasClass("_"+pluginPfx+"-t")){
|
220 |
-
t.addClass("_"+pluginPfx+"-t").data(pluginPfx,{i:i});
|
221 |
-
}
|
222 |
-
if(!$this.hasClass("_"+pluginPfx+"-h")){
|
223 |
-
$this.addClass("_"+pluginPfx+"-h");
|
224 |
-
}
|
225 |
-
var h=functions._findHighlight.call(null,id);
|
226 |
-
functions._setClasses.call(null,false,t,h);
|
227 |
-
i++
|
228 |
-
}
|
229 |
-
}
|
230 |
-
});
|
231 |
-
},
|
232 |
-
|
233 |
-
/* finds the target element */
|
234 |
-
|
235 |
-
_findTarget:function(str){
|
236 |
-
var val=(str.indexOf("#/")!==-1) ? str.split("#/")[1] : str.split("#")[1],
|
237 |
-
el=$("#"+val);
|
238 |
-
if(el.length<1 || el.css("position")==="fixed"){
|
239 |
-
if(val==="top"){
|
240 |
-
el=$("body");
|
241 |
-
}else{
|
242 |
-
return;
|
243 |
-
}
|
244 |
-
}
|
245 |
-
_target=el;
|
246 |
-
if(!_axis){
|
247 |
-
_axis=opt.layout;
|
248 |
-
}
|
249 |
-
if(!_offset){
|
250 |
-
_offset=(opt.offset) ? opt.offset : 0;
|
251 |
-
}
|
252 |
-
_to=[(el.offset().top-parseInt(_offset)).toString(),(el.offset().left-parseInt(_offset)).toString()];
|
253 |
-
_to[0]=(_to[0]<0) ? 0 : _to[0];
|
254 |
-
_to[1]=(_to[1]<0) ? 0 : _to[1];
|
255 |
-
return _to;
|
256 |
-
},
|
257 |
-
|
258 |
-
/* finds the element that should be highlighted */
|
259 |
-
|
260 |
-
_findHighlight:function(id){
|
261 |
-
var loc=window.location.toString().split("#")[0],
|
262 |
-
hHash=$("._"+pluginPfx+"-h[href='#"+id+"']"),
|
263 |
-
lhHash=$("._"+pluginPfx+"-h[href='"+loc+"#"+id+"']"),
|
264 |
-
hHashSlash=$("._"+pluginPfx+"-h[href='#/"+id+"']"),
|
265 |
-
lhHashSlash=$("._"+pluginPfx+"-h[href='"+loc+"#/"+id+"']");
|
266 |
-
hHash=(hHash.length>0) ? hHash : lhHash;
|
267 |
-
hHashSlash=(hHashSlash.length>0) ? hHashSlash : lhHashSlash;
|
268 |
-
return (hHashSlash.length>0) ? hHashSlash : hHash;
|
269 |
-
},
|
270 |
-
|
271 |
-
/* sets plugin classes */
|
272 |
-
|
273 |
-
_setClasses:function(c,t,h){
|
274 |
-
var cc=opt.clickedClass,tc=opt.targetClass,hc=opt.highlightClass;
|
275 |
-
if(c && cc && cc!==""){
|
276 |
-
$("."+cc).removeClass(cc);
|
277 |
-
_clicked.addClass(cc);
|
278 |
-
}else if(t && tc && tc!=="" && h && hc && hc!==""){
|
279 |
-
if(functions._currentTarget.call(null,t)){
|
280 |
-
if(opt.forceSingleHighlight){
|
281 |
-
$("."+hc).removeClass(hc);
|
282 |
-
}
|
283 |
-
t.addClass(tc);
|
284 |
-
h.addClass(hc);
|
285 |
-
}else{
|
286 |
-
t.removeClass(tc);
|
287 |
-
h.removeClass(hc);
|
288 |
-
}
|
289 |
-
}
|
290 |
-
},
|
291 |
-
|
292 |
-
/* checks if target element is in viewport */
|
293 |
-
|
294 |
-
_currentTarget:function(t){
|
295 |
-
var o=opt["target_"+t.data(pluginPfx).i],
|
296 |
-
rect=t[0].getBoundingClientRect();
|
297 |
-
if(typeof o!=="undefined"){
|
298 |
-
var y=t.offset().top,x=t.offset().left,
|
299 |
-
from=(o.from) ? o.from+y : y,to=(o.to) ? o.to+y : y,
|
300 |
-
fromX=(o.fromX) ? o.fromX+x : x,toX=(o.toX) ? o.toX+x : x;
|
301 |
-
return(
|
302 |
-
rect.top >= to && rect.top <= from &&
|
303 |
-
rect.left >= toX && rect.left <= fromX
|
304 |
-
);
|
305 |
-
}else{
|
306 |
-
var wh=$(window).height(),ww=$(window).width(),
|
307 |
-
base=1+(rect.height/wh),
|
308 |
-
top=base,bottom=(rect.height<wh) ? base*(wh/rect.height) : base,
|
309 |
-
baseX=1+(rect.width/ww),
|
310 |
-
left=baseX,right=(rect.width<ww) ? baseX*(ww/rect.width) : baseX;
|
311 |
-
return(
|
312 |
-
rect.top <= wh/top && rect.bottom >= wh/bottom &&
|
313 |
-
rect.left <= ww/left && rect.right >= ww/right
|
314 |
-
);
|
315 |
-
}
|
316 |
-
},
|
317 |
-
|
318 |
-
/* scrolls the page */
|
319 |
-
|
320 |
-
_scrollTo:function(){
|
321 |
-
opt.scrollSpeed=parseInt(opt.scrollSpeed);
|
322 |
-
_to=(opt.pageEndSmoothScroll) ? functions._pageEndSmoothScroll.call(null) : _to;
|
323 |
-
var el=$("html,body"),
|
324 |
-
speed=(opt.autoScrollSpeed) ? functions._autoScrollSpeed.call(null) : opt.scrollSpeed,
|
325 |
-
easing=(el.is(":animated")) ? opt.scrollingEasing : opt.scrollEasing,
|
326 |
-
_t=$(window).scrollTop(),_l=$(window).scrollLeft();
|
327 |
-
switch(_axis){
|
328 |
-
case "horizontal":
|
329 |
-
if(_l!=_to[1]){
|
330 |
-
functions._callbacks.call(null,"onStart");
|
331 |
-
el.stop().animate({scrollLeft:_to[1]},speed,easing).promise().then(function(){
|
332 |
-
functions._callbacks.call(null,"onComplete");
|
333 |
-
});
|
334 |
-
}
|
335 |
-
break;
|
336 |
-
case "auto":
|
337 |
-
if(_t!=_to[0] || _l!=_to[1]){
|
338 |
-
functions._callbacks.call(null,"onStart");
|
339 |
-
el.stop().animate({scrollTop:_to[0],scrollLeft:_to[1]},speed,easing).promise().then(function(){
|
340 |
-
functions._callbacks.call(null,"onComplete");
|
341 |
-
});
|
342 |
-
}
|
343 |
-
break;
|
344 |
-
default:
|
345 |
-
if(_t!=_to[0]){
|
346 |
-
functions._callbacks.call(null,"onStart");
|
347 |
-
el.stop().animate({scrollTop:_to[0]},speed,easing).promise().then(function(){
|
348 |
-
functions._callbacks.call(null,"onComplete");
|
349 |
-
});
|
350 |
-
}
|
351 |
-
}
|
352 |
-
},
|
353 |
-
|
354 |
-
/* sets end of page "smooth scrolling" position */
|
355 |
-
|
356 |
-
_pageEndSmoothScroll:function(){
|
357 |
-
var _dh=$(document).height(),_dw=$(document).width(),
|
358 |
-
_wh=$(window).height(),_ww=$(window).width();
|
359 |
-
return [((_dh-_to[0])<_wh) ? _dh-_wh : _to[0],((_dw-_to[1])<_ww) ? _dw-_ww : _to[1]];
|
360 |
-
},
|
361 |
-
|
362 |
-
/* sets the auto-adjusted animation speed */
|
363 |
-
|
364 |
-
_autoScrollSpeed:function(){
|
365 |
-
var _t=$(window).scrollTop(),_l=$(window).scrollLeft(),
|
366 |
-
_h=$(document).height(),_w=$(document).width(),
|
367 |
-
val=[
|
368 |
-
opt.scrollSpeed+((opt.scrollSpeed*(Math.floor((Math.abs(_to[0]-_t)/_h)*100)))/100),
|
369 |
-
opt.scrollSpeed+((opt.scrollSpeed*(Math.floor((Math.abs(_to[1]-_l)/_w)*100)))/100)
|
370 |
-
];
|
371 |
-
return Math.max.apply(Math,val);
|
372 |
-
},
|
373 |
-
|
374 |
-
/* user callback functions */
|
375 |
-
|
376 |
-
_callbacks:function(c){
|
377 |
-
if(!opt){
|
378 |
-
return;
|
379 |
-
}
|
380 |
-
this[pluginPfx]={
|
381 |
-
trigger:_trigger,clicked:_clicked,target:_target,scrollTo:{y:_to[0],x:_to[1]}
|
382 |
-
};
|
383 |
-
switch(c){
|
384 |
-
case "onStart":
|
385 |
-
opt.onStart.call(null,this[pluginPfx]);
|
386 |
-
break;
|
387 |
-
case "onComplete":
|
388 |
-
opt.onComplete.call(null,this[pluginPfx]);
|
389 |
-
break;
|
390 |
-
}
|
391 |
-
},
|
392 |
-
|
393 |
-
/* resets/clears vars and constants */
|
394 |
-
|
395 |
-
_reset:function(){
|
396 |
-
_axis=_offset=false;
|
397 |
-
},
|
398 |
-
|
399 |
-
/* checks if plugin has initialized */
|
400 |
-
|
401 |
-
_isInit:function(){
|
402 |
-
if(!_init){
|
403 |
-
methods.init.apply(this);
|
404 |
-
}
|
405 |
-
},
|
406 |
-
|
407 |
-
/* extends jquery with custom easings (as jquery ui) */
|
408 |
-
|
409 |
-
_easing:function(){
|
410 |
-
$.easing.easeInQuad=$.easing.easeInQuad ||
|
411 |
-
function(x,t,b,c,d){return c*(t/=d)*t + b;};
|
412 |
-
$.easing.easeOutQuad=$.easing.easeOutQuad ||
|
413 |
-
function(x,t,b,c,d){return -c *(t/=d)*(t-2) + b;};
|
414 |
-
$.easing.easeInOutQuad=$.easing.easeInOutQuad ||
|
415 |
-
function(x,t,b,c,d){
|
416 |
-
if ((t/=d/2) < 1) return c/2*t*t + b;
|
417 |
-
return -c/2 * ((--t)*(t-2) - 1) + b;
|
418 |
-
};
|
419 |
-
$.easing.easeInCubic=$.easing.easeInCubic ||
|
420 |
-
function(x,t,b,c,d){return c*(t/=d)*t*t + b;};
|
421 |
-
$.easing.easeOutCubic=$.easing.easeOutCubic ||
|
422 |
-
function(x,t,b,c,d){return c*((t=t/d-1)*t*t + 1) + b;};
|
423 |
-
$.easing.easeInOutCubic=$.easing.easeInOutCubic ||
|
424 |
-
function(x,t,b,c,d){
|
425 |
-
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
426 |
-
return c/2*((t-=2)*t*t + 2) + b;
|
427 |
-
};
|
428 |
-
$.easing.easeInQuart=$.easing.easeInQuart ||
|
429 |
-
function(x,t,b,c,d){return c*(t/=d)*t*t*t + b;};
|
430 |
-
$.easing.easeOutQuart=$.easing.easeOutQuart ||
|
431 |
-
function(x,t,b,c,d){return -c * ((t=t/d-1)*t*t*t - 1) + b;};
|
432 |
-
$.easing.easeInOutQuart=$.easing.easeInOutQuart ||
|
433 |
-
function(x,t,b,c,d){
|
434 |
-
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
435 |
-
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
436 |
-
};
|
437 |
-
$.easing.easeInQuint=$.easing.easeInQuint ||
|
438 |
-
function(x,t,b,c,d){return c*(t/=d)*t*t*t*t + b;};
|
439 |
-
$.easing.easeOutQuint=$.easing.easeOutQuint ||
|
440 |
-
function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t + 1) + b;};
|
441 |
-
$.easing.easeInOutQuint=$.easing.easeInOutQuint ||
|
442 |
-
function(x,t,b,c,d){
|
443 |
-
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
444 |
-
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
445 |
-
};
|
446 |
-
$.easing.easeInExpo=$.easing.easeInExpo ||
|
447 |
-
function(x,t,b,c,d){return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;};
|
448 |
-
$.easing.easeOutExpo=$.easing.easeOutExpo ||
|
449 |
-
function(x,t,b,c,d){return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;};
|
450 |
-
$.easing.easeInOutExpo=$.easing.easeInOutExpo ||
|
451 |
-
function(x,t,b,c,d){
|
452 |
-
if (t==0) return b;
|
453 |
-
if (t==d) return b+c;
|
454 |
-
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
455 |
-
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
456 |
-
};
|
457 |
-
$.easing.easeInSine=$.easing.easeInSine ||
|
458 |
-
function(x,t,b,c,d){return -c * Math.cos(t/d * (Math.PI/2)) + c + b;};
|
459 |
-
$.easing.easeOutSine=$.easing.easeOutSine ||
|
460 |
-
function(x,t,b,c,d){return c * Math.sin(t/d * (Math.PI/2)) + b;};
|
461 |
-
$.easing.easeInOutSine=$.easing.easeInOutSine ||
|
462 |
-
function(x,t,b,c,d){return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;};
|
463 |
-
$.easing.easeInCirc=$.easing.easeInCirc ||
|
464 |
-
function(x,t,b,c,d){return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;};
|
465 |
-
$.easing.easeOutCirc=$.easing.easeOutCirc ||
|
466 |
-
function(x,t,b,c,d){return c * Math.sqrt(1 - (t=t/d-1)*t) + b;};
|
467 |
-
$.easing.easeInOutCirc=$.easing.easeInOutCirc ||
|
468 |
-
function(x,t,b,c,d){
|
469 |
-
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
470 |
-
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
471 |
-
};
|
472 |
-
$.easing.easeInElastic=$.easing.easeInElastic ||
|
473 |
-
function(x,t,b,c,d){
|
474 |
-
var s=1.70158;var p=0;var a=c;
|
475 |
-
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
476 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
477 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
478 |
-
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
479 |
-
};
|
480 |
-
$.easing.easeOutElastic=$.easing.easeOutElastic ||
|
481 |
-
function(x,t,b,c,d){
|
482 |
-
var s=1.70158;var p=0;var a=c;
|
483 |
-
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
484 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
485 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
486 |
-
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
487 |
-
};
|
488 |
-
$.easing.easeInOutElastic=$.easing.easeInOutElastic ||
|
489 |
-
function(x,t,b,c,d){
|
490 |
-
var s=1.70158;var p=0;var a=c;
|
491 |
-
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
492 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
493 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
494 |
-
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
495 |
-
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
496 |
-
};
|
497 |
-
$.easing.easeInBack=$.easing.easeInBack ||
|
498 |
-
function(x,t,b,c,d,s){
|
499 |
-
if (s == undefined) s = 1.70158;
|
500 |
-
return c*(t/=d)*t*((s+1)*t - s) + b;
|
501 |
-
};
|
502 |
-
$.easing.easeOutBack=$.easing.easeOutBack ||
|
503 |
-
function(x,t,b,c,d,s){
|
504 |
-
if (s == undefined) s = 1.70158;
|
505 |
-
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
506 |
-
};
|
507 |
-
$.easing.easeInOutBack=$.easing.easeInOutBack ||
|
508 |
-
function(x,t,b,c,d,s){
|
509 |
-
if (s == undefined) s = 1.70158;
|
510 |
-
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
511 |
-
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
512 |
-
};
|
513 |
-
$.easing.easeInBounce=$.easing.easeInBounce ||
|
514 |
-
function(x,t,b,c,d){return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;};
|
515 |
-
$.easing.easeOutBounce=$.easing.easeOutBounce ||
|
516 |
-
function(x,t,b,c,d){
|
517 |
-
if ((t/=d) < (1/2.75)) {return c*(7.5625*t*t) + b;}
|
518 |
-
else if (t < (2/2.75)) {return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;}
|
519 |
-
else if (t < (2.5/2.75)) {return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;}
|
520 |
-
else {return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;}
|
521 |
-
};
|
522 |
-
$.easing.easeInOutBounce=$.easing.easeInOutBounce ||
|
523 |
-
function(x,t,b,c,d){
|
524 |
-
if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
525 |
-
return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
526 |
-
};
|
527 |
-
}
|
528 |
-
}
|
529 |
-
|
530 |
-
/*
|
531 |
-
---------------
|
532 |
-
plugin setup
|
533 |
-
---------------
|
534 |
-
*/
|
535 |
-
|
536 |
-
/* extend jquery with custom easings */
|
537 |
-
|
538 |
-
functions._easing.call();
|
539 |
-
|
540 |
-
/* plugin constructor functions */
|
541 |
-
|
542 |
-
$.fn[pluginNS]=function(method){
|
543 |
-
if(methods[method]){
|
544 |
-
return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
|
545 |
-
}else if(typeof method==="object" || !method){
|
546 |
-
return methods.init.apply(this,arguments);
|
547 |
-
}else{
|
548 |
-
$.error("Method "+method+" does not exist");
|
549 |
-
}
|
550 |
-
};
|
551 |
-
$[pluginNS]=function(method){
|
552 |
-
if(methods[method]){
|
553 |
-
return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
|
554 |
-
}else if(typeof method==="object" || !method){
|
555 |
-
return methods.init.apply(this,arguments);
|
556 |
-
}else{
|
557 |
-
$.error("Method "+method+" does not exist");
|
558 |
-
}
|
559 |
-
};
|
560 |
-
|
561 |
-
/*
|
562 |
-
allow setting plugin default options.
|
563 |
-
example: $.plugin_name.defaults.option_name="option_value";
|
564 |
-
*/
|
565 |
-
|
566 |
-
$[pluginNS].defaults=defaults;
|
567 |
-
|
568 |
-
})(jQuery,window,document);
|
1 |
+
(function(d,h,l,e){var c="mPageScroll2id",i="mPS2id",s=".m_PageScroll2id,a[rel~='m_PageScroll2id'],.page-scroll-to-id,a[rel~='page-scroll-to-id']",j={scrollSpeed:1300,autoScrollSpeed:true,scrollEasing:"easeInOutExpo",scrollingEasing:"easeInOutCirc",pageEndSmoothScroll:true,layout:"vertical",offset:0,highlightSelector:false,clickedClass:i+"-clicked",targetClass:i+"-target",highlightClass:i+"-highlight",forceSingleHighlight:false,clickEvents:true,onStart:function(){},onComplete:function(){},defaultSelector:false},p,b,g,a,q,f,n,o,m,r={init:function(t){var t=d.extend(true,{},j,t);d(l).data(i,t);b=d(l).data(i);p=(!p)?this.selector:p+","+this.selector;if(b.defaultSelector){if(typeof d(p)!=="object"||d(p).length===0){p=s}}if(b.clickEvents){d(l).undelegate("."+i).delegate(p,"click."+i,function(w){var v=d(this),u=v.attr("href"),x=v.prop("href");if(u&&u.indexOf("#/")!==-1){return}k._reset.call(null);if(k._isValid.call(null,u,x)&&k._findTarget.call(null,u)){w.preventDefault();a="selector";q=v;k._setClasses.call(null,true);k._scrollTo.call(null)}})}d(h).unbind("."+i).bind("scroll."+i+" resize."+i,function(){var u=d("._"+i+"-t");u.each(function(){var v=d(this),x=v.attr("id"),w=k._findHighlight.call(null,x);k._setClasses.call(null,false,v,w)})});g=true;k._setup.call(null)},scrollTo:function(v,t){if(v&&typeof v!=="undefined"){k._isInit.call(null);var u={layout:b.layout,offset:b.offset,clicked:false},t=d.extend(true,{},u,t);k._reset.call(null);o=t.layout;m=t.offset;v=(v.indexOf("#")!==-1)?v:"#"+v;if(k._isValid.call(null,v)&&k._findTarget.call(null,v)){a="scrollTo";q=t.clicked;if(q){k._setClasses.call(null,true)}k._scrollTo.call(null)}}},destroy:function(){d(h).unbind("."+i);d(l).undelegate("."+i).removeData(i);d("."+b.clickedClass).removeClass(b.clickedClass);d("."+b.targetClass).removeClass(b.targetClass);d("."+b.highlightClass).removeClass(b.highlightClass);d("._"+i+"-t").removeData(i).removeClass("_"+i+"-t");d("._"+i+"-h").removeClass("_"+i+"-h")}},k={_isValid:function(t,w){if(!t){return}w=(!w)?t:w;var v=(w.indexOf("#/")!==-1)?w.split("#/")[0]:w.split("#")[0],u=h.location.toString().split("#")[0];return t!=="#"&&t.indexOf("#")!==-1&&(v===""||v===u)},_setup:function(){var u=(b.highlightSelector&&b.highlightSelector!=="")?b.highlightSelector:p,t=1;return d(u).each(function(){var y=d(this),v=y.attr("href"),A=y.prop("href");if(k._isValid.call(null,v,A)){var z=(v.indexOf("#/")!==-1)?v.split("#/")[1]:v.split("#")[1],w=d("#"+z);if(w.length>0){if(!w.hasClass("_"+i+"-t")){w.addClass("_"+i+"-t").data(i,{i:t})}if(!y.hasClass("_"+i+"-h")){y.addClass("_"+i+"-h")}var x=k._findHighlight.call(null,z);k._setClasses.call(null,false,w,x);t++}}})},_findTarget:function(v){var u=(v.indexOf("#/")!==-1)?v.split("#/")[1]:v.split("#")[1],t=d("#"+u);if(t.length<1||t.css("position")==="fixed"){if(u==="top"){t=d("body")}else{return}}f=t;if(!o){o=b.layout}if(!m){m=(b.offset)?b.offset:0}n=[(t.offset().top-parseInt(m)).toString(),(t.offset().left-parseInt(m)).toString()];n[0]=(n[0]<0)?0:n[0];n[1]=(n[1]<0)?0:n[1];return n},_findHighlight:function(y){var x=h.location.toString().split("#")[0],u=d("._"+i+"-h[href='#"+y+"']"),v=d("._"+i+"-h[href='"+x+"#"+y+"']"),t=d("._"+i+"-h[href='#/"+y+"']"),w=d("._"+i+"-h[href='"+x+"#/"+y+"']");u=(u.length>0)?u:v;t=(t.length>0)?t:w;return(t.length>0)?t:u},_setClasses:function(z,v,w){var y=b.clickedClass,u=b.targetClass,x=b.highlightClass;if(z&&y&&y!==""){d("."+y).removeClass(y);q.addClass(y)}else{if(v&&u&&u!==""&&w&&x&&x!==""){if(k._currentTarget.call(null,v)){if(b.forceSingleHighlight){d("."+x).removeClass(x)}v.addClass(u);w.addClass(x)}else{v.removeClass(u);w.removeClass(x)}}}},_currentTarget:function(H){var K=b["target_"+H.data(i).i],w=H[0].getBoundingClientRect();if(typeof K!=="undefined"){var F=H.offset().top,G=H.offset().left,L=(K.from)?K.from+F:F,z=(K.to)?K.to+F:F,I=(K.fromX)?K.fromX+G:G,v=(K.toX)?K.toX+G:G;return(w.top>=z&&w.top<=L&&w.left>=v&&w.left<=I)}else{var D=d(h).height(),O=d(h).width(),C=H.height(),N=H.width(),B=1+(C/D),J=B,E=(C<D)?B*(D/C):B,u=1+(N/O),A=u,M=(N<O)?u*(O/N):u;return(w.top<=D/J&&w.bottom>=D/E&&w.left<=O/A&&w.right>=O/M)}},_scrollTo:function(){b.scrollSpeed=parseInt(b.scrollSpeed);n=(b.pageEndSmoothScroll)?k._pageEndSmoothScroll.call(null):n;var u=d("html,body"),w=(b.autoScrollSpeed)?k._autoScrollSpeed.call(null):b.scrollSpeed,y=(u.is(":animated"))?b.scrollingEasing:b.scrollEasing,v=d(h).scrollTop(),t=d(h).scrollLeft();switch(o){case"horizontal":if(t!=n[1]){k._callbacks.call(null,"onStart");u.stop().animate({scrollLeft:n[1]},w,y).promise().then(function(){k._callbacks.call(null,"onComplete")})}break;case"auto":if(v!=n[0]||t!=n[1]){k._callbacks.call(null,"onStart");if(navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/)){var x;u.stop().animate({pageYOffset:n[0],pageXOffset:n[1]},{duration:w,easing:y,step:function(z,A){if(A.prop=="pageXOffset"){x=z}else{if(A.prop=="pageYOffset"){h.scrollTo(x,z)}}}}).promise().then(function(){k._callbacks.call(null,"onComplete")})}else{u.stop().animate({scrollTop:n[0],scrollLeft:n[1]},w,y).promise().then(function(){k._callbacks.call(null,"onComplete")})}}break;default:if(v!=n[0]){k._callbacks.call(null,"onStart");u.stop().animate({scrollTop:n[0]},w,y).promise().then(function(){k._callbacks.call(null,"onComplete")})}}},_pageEndSmoothScroll:function(){var t=d(l).height(),w=d(l).width(),v=d(h).height(),u=d(h).width();return[((t-n[0])<v)?t-v:n[0],((w-n[1])<u)?w-u:n[1]]},_autoScrollSpeed:function(){var v=d(h).scrollTop(),u=d(h).scrollLeft(),w=d(l).height(),t=d(l).width(),x=[b.scrollSpeed+((b.scrollSpeed*(Math.floor((Math.abs(n[0]-v)/w)*100)))/100),b.scrollSpeed+((b.scrollSpeed*(Math.floor((Math.abs(n[1]-u)/t)*100)))/100)];return Math.max.apply(Math,x)},_callbacks:function(t){if(!b){return}this[i]={trigger:a,clicked:q,target:f,scrollTo:{y:n[0],x:n[1]}};switch(t){case"onStart":b.onStart.call(null,this[i]);break;case"onComplete":b.onComplete.call(null,this[i]);break}},_reset:function(){o=m=false},_isInit:function(){if(!g){r.init.apply(this)}},_easing:function(){d.easing.easeInQuad=d.easing.easeInQuad||function(v,w,u,z,y){return z*(w/=y)*w+u};d.easing.easeOutQuad=d.easing.easeOutQuad||function(v,w,u,z,y){return -z*(w/=y)*(w-2)+u};d.easing.easeInOutQuad=d.easing.easeInOutQuad||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w+u}return -z/2*((--w)*(w-2)-1)+u};d.easing.easeInCubic=d.easing.easeInCubic||function(v,w,u,z,y){return z*(w/=y)*w*w+u};d.easing.easeOutCubic=d.easing.easeOutCubic||function(v,w,u,z,y){return z*((w=w/y-1)*w*w+1)+u};d.easing.easeInOutCubic=d.easing.easeInOutCubic||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w*w+u}return z/2*((w-=2)*w*w+2)+u};d.easing.easeInQuart=d.easing.easeInQuart||function(v,w,u,z,y){return z*(w/=y)*w*w*w+u};d.easing.easeOutQuart=d.easing.easeOutQuart||function(v,w,u,z,y){return -z*((w=w/y-1)*w*w*w-1)+u};d.easing.easeInOutQuart=d.easing.easeInOutQuart||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w*w*w+u}return -z/2*((w-=2)*w*w*w-2)+u};d.easing.easeInQuint=d.easing.easeInQuint||function(v,w,u,z,y){return z*(w/=y)*w*w*w*w+u};d.easing.easeOutQuint=d.easing.easeOutQuint||function(v,w,u,z,y){return z*((w=w/y-1)*w*w*w*w+1)+u};d.easing.easeInOutQuint=d.easing.easeInOutQuint||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w*w*w*w+u}return z/2*((w-=2)*w*w*w*w+2)+u};d.easing.easeInExpo=d.easing.easeInExpo||function(v,w,u,z,y){return(w==0)?u:z*Math.pow(2,10*(w/y-1))+u};d.easing.easeOutExpo=d.easing.easeOutExpo||function(v,w,u,z,y){return(w==y)?u+z:z*(-Math.pow(2,-10*w/y)+1)+u};d.easing.easeInOutExpo=d.easing.easeInOutExpo||function(v,w,u,z,y){if(w==0){return u}if(w==y){return u+z}if((w/=y/2)<1){return z/2*Math.pow(2,10*(w-1))+u}return z/2*(-Math.pow(2,-10*--w)+2)+u};d.easing.easeInSine=d.easing.easeInSine||function(v,w,u,z,y){return -z*Math.cos(w/y*(Math.PI/2))+z+u};d.easing.easeOutSine=d.easing.easeOutSine||function(v,w,u,z,y){return z*Math.sin(w/y*(Math.PI/2))+u};d.easing.easeInOutSine=d.easing.easeInOutSine||function(v,w,u,z,y){return -z/2*(Math.cos(Math.PI*w/y)-1)+u};d.easing.easeInCirc=d.easing.easeInCirc||function(v,w,u,z,y){return -z*(Math.sqrt(1-(w/=y)*w)-1)+u};d.easing.easeOutCirc=d.easing.easeOutCirc||function(v,w,u,z,y){return z*Math.sqrt(1-(w=w/y-1)*w)+u};d.easing.easeInOutCirc=d.easing.easeInOutCirc||function(v,w,u,z,y){if((w/=y/2)<1){return -z/2*(Math.sqrt(1-w*w)-1)+u}return z/2*(Math.sqrt(1-(w-=2)*w)+1)+u};d.easing.easeInElastic=d.easing.easeInElastic||function(v,y,u,C,B){var z=1.70158;var A=0;var w=C;if(y==0){return u}if((y/=B)==1){return u+C}if(!A){A=B*0.3}if(w<Math.abs(C)){w=C;var z=A/4}else{var z=A/(2*Math.PI)*Math.asin(C/w)}return -(w*Math.pow(2,10*(y-=1))*Math.sin((y*B-z)*(2*Math.PI)/A))+u};d.easing.easeOutElastic=d.easing.easeOutElastic||function(v,y,u,C,B){var z=1.70158;var A=0;var w=C;if(y==0){return u}if((y/=B)==1){return u+C}if(!A){A=B*0.3}if(w<Math.abs(C)){w=C;var z=A/4}else{var z=A/(2*Math.PI)*Math.asin(C/w)}return w*Math.pow(2,-10*y)*Math.sin((y*B-z)*(2*Math.PI)/A)+C+u};d.easing.easeInOutElastic=d.easing.easeInOutElastic||function(v,y,u,C,B){var z=1.70158;var A=0;var w=C;if(y==0){return u}if((y/=B/2)==2){return u+C}if(!A){A=B*(0.3*1.5)}if(w<Math.abs(C)){w=C;var z=A/4}else{var z=A/(2*Math.PI)*Math.asin(C/w)}if(y<1){return -0.5*(w*Math.pow(2,10*(y-=1))*Math.sin((y*B-z)*(2*Math.PI)/A))+u}return w*Math.pow(2,-10*(y-=1))*Math.sin((y*B-z)*(2*Math.PI)/A)*0.5+C+u};d.easing.easeInBack=d.easing.easeInBack||function(v,w,u,A,z,y){if(y==e){y=1.70158}return A*(w/=z)*w*((y+1)*w-y)+u};d.easing.easeOutBack=d.easing.easeOutBack||function(v,w,u,A,z,y){if(y==e){y=1.70158}return A*((w=w/z-1)*w*((y+1)*w+y)+1)+u};d.easing.easeInOutBack=d.easing.easeInOutBack||function(v,w,u,A,z,y){if(y==e){y=1.70158}if((w/=z/2)<1){return A/2*(w*w*(((y*=(1.525))+1)*w-y))+u}return A/2*((w-=2)*w*(((y*=(1.525))+1)*w+y)+2)+u};d.easing.easeInBounce=d.easing.easeInBounce||function(v,w,u,z,y){return z-d.easing.easeOutBounce(v,y-w,0,z,y)+u};d.easing.easeOutBounce=d.easing.easeOutBounce||function(v,w,u,z,y){if((w/=y)<(1/2.75)){return z*(7.5625*w*w)+u}else{if(w<(2/2.75)){return z*(7.5625*(w-=(1.5/2.75))*w+0.75)+u}else{if(w<(2.5/2.75)){return z*(7.5625*(w-=(2.25/2.75))*w+0.9375)+u}else{return z*(7.5625*(w-=(2.625/2.75))*w+0.984375)+u}}}};d.easing.easeInOutBounce=d.easing.easeInOutBounce||function(v,w,u,z,y){if(w<y/2){return d.easing.easeInBounce(v,w*2,0,z,y)*0.5+u}return d.easing.easeOutBounce(v,w*2-y,0,z,y)*0.5+z*0.5+u}}};k._easing.call();d.fn[c]=function(t){if(r[t]){return r[t].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof t==="object"||!t){return r.init.apply(this,arguments)}else{d.error("Method "+t+" does not exist")}}};d[c]=function(t){if(r[t]){return r[t].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof t==="object"||!t){return r.init.apply(this,arguments)}else{d.error("Method "+t+" does not exist")}}};d[c].defaults=j})(jQuery,window,document);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
malihu-pagescroll2id.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Page scroll to id
|
4 |
Plugin URI: http://manos.malihu.gr/page-scroll-to-id
|
5 |
Description: Page scroll to id is an easy-to-use jQuery plugin that enables animated page scrolling to specific id within the document.
|
6 |
-
Version: 1.5.
|
7 |
Author: malihu
|
8 |
Author URI: http://manos.malihu.gr
|
9 |
License: GNU GENERAL PUBLIC LICENSE Version 3
|
@@ -40,7 +40,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
40 |
|
41 |
class malihuPageScroll2id{ // --edit--
|
42 |
|
43 |
-
protected $version='1.5.
|
44 |
protected $update_option=null;
|
45 |
|
46 |
protected $plugin_name='Page scroll to id'; // Plugin name --edit--
|
@@ -59,8 +59,8 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
59 |
protected $plugin_init_script='jquery.malihu.PageScroll2id-init.js'; // Plugin public initialization script --edit--
|
60 |
|
61 |
private function __construct(){
|
62 |
-
// Plugin requires WP version 3.
|
63 |
-
if(get_bloginfo('version') < '3.
|
64 |
add_action('admin_notices', array($this, 'admin_notice_wp_version'));
|
65 |
return;
|
66 |
}
|
@@ -104,7 +104,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
104 |
|
105 |
// WP version notice
|
106 |
public function admin_notice_wp_version(){
|
107 |
-
_e('<div class="error"><p>'.$this->plugin_name.' requires WordPress version 3.
|
108 |
}
|
109 |
|
110 |
// Plugin localization (load plugin textdomain)
|
3 |
Plugin Name: Page scroll to id
|
4 |
Plugin URI: http://manos.malihu.gr/page-scroll-to-id
|
5 |
Description: Page scroll to id is an easy-to-use jQuery plugin that enables animated page scrolling to specific id within the document.
|
6 |
+
Version: 1.5.1
|
7 |
Author: malihu
|
8 |
Author URI: http://manos.malihu.gr
|
9 |
License: GNU GENERAL PUBLIC LICENSE Version 3
|
40 |
|
41 |
class malihuPageScroll2id{ // --edit--
|
42 |
|
43 |
+
protected $version='1.5.1'; // Plugin version --edit--
|
44 |
protected $update_option=null;
|
45 |
|
46 |
protected $plugin_name='Page scroll to id'; // Plugin name --edit--
|
59 |
protected $plugin_init_script='jquery.malihu.PageScroll2id-init.js'; // Plugin public initialization script --edit--
|
60 |
|
61 |
private function __construct(){
|
62 |
+
// Plugin requires WP version 3.3 or higher
|
63 |
+
if(get_bloginfo('version') < '3.3'){
|
64 |
add_action('admin_notices', array($this, 'admin_notice_wp_version'));
|
65 |
return;
|
66 |
}
|
104 |
|
105 |
// WP version notice
|
106 |
public function admin_notice_wp_version(){
|
107 |
+
_e('<div class="error"><p>'.$this->plugin_name.' requires WordPress version 3.3 or higher. Deactivate the plugin and reactivate when WordPress is updated.</p></div>', $this->plugin_slug);
|
108 |
}
|
109 |
|
110 |
// Plugin localization (load plugin textdomain)
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Page scroll to id ===
|
2 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28
|
3 |
Tags: page scrolling, page animation, navigation, single-page navigation
|
4 |
-
Requires at least: 3.
|
5 |
Tested up to: 3.8
|
6 |
-
Stable tag: 1.5.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -27,7 +27,7 @@ The plugin replaces the default browser behaviour of "jumping" to page sections
|
|
27 |
|
28 |
= Requirements =
|
29 |
|
30 |
-
Page scroll to id requires WordPress version **3.
|
31 |
|
32 |
= Quick usage =
|
33 |
|
@@ -110,6 +110,10 @@ Yes but you probably need to implement the plugin in your theme **manually**. Se
|
|
110 |
|
111 |
== Changelog ==
|
112 |
|
|
|
|
|
|
|
|
|
113 |
= 1.5.0 =
|
114 |
* Dropped jQuery UI dependency (jQuery UI is no longer required for the plugin to work).
|
115 |
* Fixed the bug of non-working links to other pages. The script now checks if href values refer to the parent document, before preventing the default behavior.
|
1 |
=== Page scroll to id ===
|
2 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28
|
3 |
Tags: page scrolling, page animation, navigation, single-page navigation
|
4 |
+
Requires at least: 3.3
|
5 |
Tested up to: 3.8
|
6 |
+
Stable tag: 1.5.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
27 |
|
28 |
= Requirements =
|
29 |
|
30 |
+
Page scroll to id requires WordPress version **3.3** or higher and jQuery version **1.6.0** or higher. For older installations implement it in your theme manually.
|
31 |
|
32 |
= Quick usage =
|
33 |
|
110 |
|
111 |
== Changelog ==
|
112 |
|
113 |
+
= 1.5.1 =
|
114 |
+
* Minor code tweaks
|
115 |
+
* Minified scripts
|
116 |
+
|
117 |
= 1.5.0 =
|
118 |
* Dropped jQuery UI dependency (jQuery UI is no longer required for the plugin to work).
|
119 |
* Fixed the bug of non-working links to other pages. The script now checks if href values refer to the parent document, before preventing the default behavior.
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|