Version Description
- Update scroll script
Download this release
Release Info
Developer | kubiq |
Plugin | MouseWheel Smooth Scroll |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.0.3
- js/jquery.browser.min.js +0 -1
- js/jquery.simplr.smoothscroll.js +64 -34
- js/wpmss.php +6 -4
- mousewheel-smooth-scroll.php +6 -7
- readme.txt +12 -3
js/jquery.browser.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function(a){"function"==typeof define&&define.amd?define(["jquery"],function(b){a(b)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b,c;if(a.uaMatch=function(a){a=a.toLowerCase();var b=/(edge)\/([\w.]+)/.exec(a)||/(opr)[\/]([\w.]+)/.exec(a)||/(chrome)[ \/]([\w.]+)/.exec(a)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[],c=/(ipad)/.exec(a)||/(ipod)/.exec(a)||/(iphone)/.exec(a)||/(kindle)/.exec(a)||/(silk)/.exec(a)||/(android)/.exec(a)||/(windows phone)/.exec(a)||/(win)/.exec(a)||/(mac)/.exec(a)||/(linux)/.exec(a)||/(cros)/.exec(a)||/(playbook)/.exec(a)||/(bb)/.exec(a)||/(blackberry)/.exec(a)||[];return{browser:b[5]||b[3]||b[1]||"",version:b[2]||b[4]||"0",versionNumber:b[4]||b[2]||"0",platform:c[0]||""}},b=a.uaMatch(window.navigator.userAgent),c={},b.browser&&(c[b.browser]=!0,c.version=b.version,c.versionNumber=parseInt(b.versionNumber,10)),b.platform&&(c[b.platform]=!0),(c.android||c.bb||c.blackberry||c.ipad||c.iphone||c.ipod||c.kindle||c.playbook||c.silk||c["windows phone"])&&(c.mobile=!0),(c.cros||c.mac||c.linux||c.win)&&(c.desktop=!0),(c.chrome||c.opr||c.safari)&&(c.webkit=!0),c.rv||c.edge){var d="msie";b.browser=d,c[d]=!0}if(c.safari&&c.blackberry){var e="blackberry";b.browser=e,c[e]=!0}if(c.safari&&c.playbook){var f="playbook";b.browser=f,c[f]=!0}if(c.bb){var g="blackberry";b.browser=g,c[g]=!0}if(c.opr){var h="opera";b.browser=h,c[h]=!0}if(c.safari&&c.android){var i="android";b.browser=i,c[i]=!0}if(c.safari&&c.kindle){var j="kindle";b.browser=j,c[j]=!0}if(c.safari&&c.silk){var k="silk";b.browser=k,c[k]=!0}return c.name=b.browser,c.platform=b.platform,a.browser=c,c});
|
|
js/jquery.simplr.smoothscroll.js
CHANGED
@@ -1,34 +1,64 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jquery.simplr.smoothscroll
|
3 |
+
* version 1.0
|
4 |
+
* copyright (c) 2012 https://github.com/simov/simplr-smoothscroll
|
5 |
+
* licensed under MIT
|
6 |
+
* requires jquery.mousewheel - https://github.com/brandonaaron/jquery-mousewheel/
|
7 |
+
*/
|
8 |
+
|
9 |
+
;(function ($) {
|
10 |
+
'use strict'
|
11 |
+
|
12 |
+
$.srSmoothscroll = function (options) {
|
13 |
+
|
14 |
+
var self = $.extend({
|
15 |
+
step: 55,
|
16 |
+
speed: 400,
|
17 |
+
ease: 'swing',
|
18 |
+
target: $('body'),
|
19 |
+
container: $(window)
|
20 |
+
}, options || {})
|
21 |
+
|
22 |
+
// private fields & init
|
23 |
+
var container = self.container
|
24 |
+
, top = 0
|
25 |
+
, step = self.step
|
26 |
+
, viewport = container.height()
|
27 |
+
, wheel = false
|
28 |
+
|
29 |
+
var target
|
30 |
+
if (self.target.selector == 'body') {
|
31 |
+
target = (navigator.userAgent.indexOf('AppleWebKit') !== -1) ? self.target : $('html')
|
32 |
+
} else {
|
33 |
+
target = container
|
34 |
+
}
|
35 |
+
|
36 |
+
// events
|
37 |
+
self.target.mousewheel(function (event, delta) {
|
38 |
+
|
39 |
+
wheel = true
|
40 |
+
|
41 |
+
if (delta < 0) // down
|
42 |
+
top = (top+viewport) >= self.target.outerHeight(true) ? top : top+=step
|
43 |
+
|
44 |
+
else // up
|
45 |
+
top = top <= 0 ? 0 : top-=step
|
46 |
+
|
47 |
+
target.stop().animate({scrollTop: top}, self.speed, self.ease, function () {
|
48 |
+
wheel = false
|
49 |
+
})
|
50 |
+
|
51 |
+
return false
|
52 |
+
})
|
53 |
+
|
54 |
+
container
|
55 |
+
.on('resize', function (e) {
|
56 |
+
viewport = container.height()
|
57 |
+
})
|
58 |
+
.on('scroll', function (e) {
|
59 |
+
if (!wheel)
|
60 |
+
top = container.scrollTop()
|
61 |
+
})
|
62 |
+
|
63 |
+
}
|
64 |
+
})(jQuery);
|
js/wpmss.php
CHANGED
@@ -3,13 +3,15 @@ jQuery(document).ready(function($) {
|
|
3 |
});
|
4 |
|
5 |
function MouseSmoothScroll(){
|
6 |
-
<?php if ( $_GET['enableAll'] == 0 ): ?>
|
7 |
-
|
8 |
-
if(
|
9 |
<?php endif ?>
|
10 |
jQuery.srSmoothscroll({
|
11 |
step: <?php echo $_GET['step'] ?>,
|
12 |
speed: <?php echo $_GET['speed'] ?>,
|
13 |
-
ease: '<?php echo $_GET['ease'] ?>'
|
|
|
|
|
14 |
});
|
15 |
}
|
3 |
});
|
4 |
|
5 |
function MouseSmoothScroll(){
|
6 |
+
<?php if ( $_GET['enableAll'] == 0 ): ?>
|
7 |
+
isMac = /(mac)/.exec( window.navigator.userAgent.toLowerCase() );
|
8 |
+
if( isMac != null && isMac.length ) return false;
|
9 |
<?php endif ?>
|
10 |
jQuery.srSmoothscroll({
|
11 |
step: <?php echo $_GET['step'] ?>,
|
12 |
speed: <?php echo $_GET['speed'] ?>,
|
13 |
+
ease: '<?php echo $_GET['ease'] ?>',
|
14 |
+
target: jQuery('body'),
|
15 |
+
container: jQuery(window)
|
16 |
});
|
17 |
}
|
mousewheel-smooth-scroll.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: MouseWheel Smooth Scroll
|
4 |
Plugin URI: http://kubiq.sk
|
5 |
Description: MouseWheel smooth scrolling for your WordPress website
|
6 |
-
Version: 1.0
|
7 |
Author: Jakub Novák
|
8 |
Author URI: http://kubiq.sk
|
9 |
*/
|
@@ -51,12 +51,11 @@ if (!class_exists('wpmss')) {
|
|
51 |
}
|
52 |
|
53 |
function plugin_scripts_load() {
|
54 |
-
wp_enqueue_script( 'wpmss_jquery_browser', plugins_url( 'js/jquery.browser.min.js' , __FILE__ ));
|
55 |
wp_enqueue_script( 'wpmss_jquery_mousewheel', plugins_url( 'js/jquery.mousewheel.min.js' , __FILE__ ));
|
56 |
wp_enqueue_script( 'wpmss_jquery_easing', plugins_url( 'js/jquery.easing.1.3.js' , __FILE__ ));
|
57 |
$options = array(
|
58 |
-
'step' => isset( $this->settings['general']['step'] ) ? $this->settings['general']['step'] :
|
59 |
-
'speed' => isset( $this->settings['general']['speed'] ) ? $this->settings['general']['speed'] :
|
60 |
'ease' => isset( $this->settings['general']['ease'] ) ? $this->settings['general']['ease'] : 'easeOutCubic',
|
61 |
'enableAll' => isset( $this->settings['general']['enable_mac'] ) ? 1 : 0
|
62 |
);
|
@@ -106,7 +105,7 @@ if (!class_exists('wpmss')) {
|
|
106 |
<label for="q_field_1"><?php _e("Step:", $this->domain) ?></label>
|
107 |
</th>
|
108 |
<td>
|
109 |
-
<input type="text" name="step" placeholder="
|
110 |
</td>
|
111 |
</tr>
|
112 |
<tr>
|
@@ -114,7 +113,7 @@ if (!class_exists('wpmss')) {
|
|
114 |
<label for="q_field_2"><?php _e("Speed:", $this->domain) ?></label>
|
115 |
</th>
|
116 |
<td>
|
117 |
-
<input type="text" name="speed" placeholder="
|
118 |
</td>
|
119 |
</tr>
|
120 |
<tr>
|
@@ -179,7 +178,7 @@ if (!class_exists('wpmss')) {
|
|
179 |
<p><?php _e('Any ideas, problems, issues?', $this->domain) ?></p>
|
180 |
<p>Ing. Jakub Novák</p>
|
181 |
<p><a href="mailto:info@kubiq.sk" target="_blank">info@kubiq.sk</a></p>
|
182 |
-
<p><a href="
|
183 |
}
|
184 |
|
185 |
function q_select( $field_data = array(), $print = 1 ){
|
3 |
Plugin Name: MouseWheel Smooth Scroll
|
4 |
Plugin URI: http://kubiq.sk
|
5 |
Description: MouseWheel smooth scrolling for your WordPress website
|
6 |
+
Version: 1.0.3
|
7 |
Author: Jakub Novák
|
8 |
Author URI: http://kubiq.sk
|
9 |
*/
|
51 |
}
|
52 |
|
53 |
function plugin_scripts_load() {
|
|
|
54 |
wp_enqueue_script( 'wpmss_jquery_mousewheel', plugins_url( 'js/jquery.mousewheel.min.js' , __FILE__ ));
|
55 |
wp_enqueue_script( 'wpmss_jquery_easing', plugins_url( 'js/jquery.easing.1.3.js' , __FILE__ ));
|
56 |
$options = array(
|
57 |
+
'step' => isset( $this->settings['general']['step'] ) && trim( $this->settings['general']['step'] ) != "" ? $this->settings['general']['step'] : 120,
|
58 |
+
'speed' => isset( $this->settings['general']['speed'] ) && trim( $this->settings['general']['step'] ) != "" ? $this->settings['general']['speed'] : 800,
|
59 |
'ease' => isset( $this->settings['general']['ease'] ) ? $this->settings['general']['ease'] : 'easeOutCubic',
|
60 |
'enableAll' => isset( $this->settings['general']['enable_mac'] ) ? 1 : 0
|
61 |
);
|
105 |
<label for="q_field_1"><?php _e("Step:", $this->domain) ?></label>
|
106 |
</th>
|
107 |
<td>
|
108 |
+
<input type="text" name="step" placeholder="120" value="<?php echo $this->settings[ $this->tab ]["step"]; ?>" id="q_field_1">
|
109 |
</td>
|
110 |
</tr>
|
111 |
<tr>
|
113 |
<label for="q_field_2"><?php _e("Speed:", $this->domain) ?></label>
|
114 |
</th>
|
115 |
<td>
|
116 |
+
<input type="text" name="speed" placeholder="800" value="<?php echo $this->settings[ $this->tab ]["speed"]; ?>" id="q_field_2">
|
117 |
</td>
|
118 |
</tr>
|
119 |
<tr>
|
178 |
<p><?php _e('Any ideas, problems, issues?', $this->domain) ?></p>
|
179 |
<p>Ing. Jakub Novák</p>
|
180 |
<p><a href="mailto:info@kubiq.sk" target="_blank">info@kubiq.sk</a></p>
|
181 |
+
<p><a href="http://kubiq.sk/" target="_blank">http://kubiq.sk</a></p><?php
|
182 |
}
|
183 |
|
184 |
function q_select( $field_data = array(), $print = 1 ){
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://kubiq.sk
|
|
4 |
Tags: smooth scroll, mousewheel scroll, scrolling
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.1
|
7 |
-
Stable tag: 1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -12,7 +12,7 @@ Smooth scrolling experience, with mousewheel or touchpad
|
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
Replace basic scrolling "
|
16 |
|
17 |
<ul>
|
18 |
<li>set speed</li>
|
@@ -34,4 +34,13 @@ Replace basic scrolling "efect" on Windows, Linux and some browsers with nice sm
|
|
34 |
== Changelog ==
|
35 |
|
36 |
= 1.0 =
|
37 |
-
* First version
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
Tags: smooth scroll, mousewheel scroll, scrolling
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.1
|
7 |
+
Stable tag: 1.0.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
Replace basic scrolling "effect" on Windows, Linux and some browsers with nice smooth scroll
|
16 |
|
17 |
<ul>
|
18 |
<li>set speed</li>
|
34 |
== Changelog ==
|
35 |
|
36 |
= 1.0 =
|
37 |
+
* First version
|
38 |
+
|
39 |
+
= 1.0.1 =
|
40 |
+
* Optimalisation
|
41 |
+
|
42 |
+
= 1.0.2 =
|
43 |
+
* Improve / change default settings
|
44 |
+
|
45 |
+
= 1.0.3 =
|
46 |
+
* Update scroll script
|