Sticky Menu (or Anything!) on Scroll - Version 1.1.3

Version Description

  • Fixes width calculation bug introduced in previous version (sorry about that), box sizing now supported.
Download this release

Release Info

Developer senff
Plugin Icon 128x128 Sticky Menu (or Anything!) on Scroll
Version 1.1.3
Comparing to
See all releases

Code changes from version 1.1.2 to 1.1.3

README.md CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://www.senff.com/plugins/sticky-anything-wp
5
  * Requires at least: 3.6
6
  * Tested up to: 4.0
7
- * Stable tag: 1.1.2
8
  * License: GPLv2 or later
9
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -59,21 +59,27 @@ For any other issues, please use the [WordPress.org forum](https://wordpress.org
59
 
60
  ## Changelog
61
 
 
 
 
62
  ### 1.1.2
63
- * Fixes element width calculation bug
64
 
65
  ### 1.1.1
66
- * Fixes viewport calculation bug
67
 
68
  ### 1.1
69
- * Added functionality for optional minimum/maximum screen size
70
 
71
  ### 1.0
72
- * initial release (using v1.1 of the standalone jQuery plugin)
73
 
74
 
75
  ## Upgrade Notice
76
 
 
 
 
77
  ### 1.1.2
78
  Fixes element width calculation bug.
79
 
@@ -84,4 +90,4 @@ Fixes viewport calculation bug.
84
  Added functionality: you can now set a minimum and/or maximum screen size where the element should be sticky (handy for responsive designs, should you not want your element to be sticky below or above certain screen sizes).
85
 
86
  ### 1.0
87
- Initial release of the plugin
4
  * Plugin URI: http://www.senff.com/plugins/sticky-anything-wp
5
  * Requires at least: 3.6
6
  * Tested up to: 4.0
7
+ * Stable tag: 1.1.3
8
  * License: GPLv2 or later
9
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
59
 
60
  ## Changelog
61
 
62
+ ### 1.1.3
63
+ * Fixes width calculation bug introduced in previous version (sorry about that), box sizing now supported.
64
+
65
  ### 1.1.2
66
+ * Fixes element width calculation bug.
67
 
68
  ### 1.1.1
69
+ * Fixes viewport calculation bug.
70
 
71
  ### 1.1
72
+ * Added functionality for optional minimum/maximum screen size.
73
 
74
  ### 1.0
75
+ * Initial release (using v1.1 of the standalone jQuery plugin).
76
 
77
 
78
  ## Upgrade Notice
79
 
80
+ ### 1.1.3
81
+ Fixes width calculation bug introduced in previous version (sorry about that), box sizing now supported.
82
+
83
  ### 1.1.2
84
  Fixes element width calculation bug.
85
 
90
  Added functionality: you can now set a minimum and/or maximum screen size where the element should be sticky (handy for responsive designs, should you not want your element to be sticky below or above certain screen sizes).
91
 
92
  ### 1.0
93
+ Initial release of the plugin.
assets/js/jq-sticky-anything.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * @preserve Sticky Anything 1.1.2 | @senff | GPL2 Licensed
3
  */
4
 
5
  (function ($) {
@@ -61,9 +61,9 @@ function stickIt(stickyTop,minwidth,maxwidth) {
61
  orgElement = $('.original');
62
  coordsOrgElement = orgElement.offset();
63
  leftOrgElement = coordsOrgElement.left;
64
- widthOrgElement = orgElement.outerWidth();
65
 
66
- $('.cloned').css('left',leftOrgElement+'px').css('top',stickyTop+'px').css('width',widthOrgElement+'px').show();
67
  $('.original').css('visibility','hidden');
68
  } else {
69
  // not scrolled past the menu; only show the original menu.
1
  /**
2
+ * @preserve Sticky Anything 1.1.3 | @senff | GPL2 Licensed
3
  */
4
 
5
  (function ($) {
61
  orgElement = $('.original');
62
  coordsOrgElement = orgElement.offset();
63
  leftOrgElement = coordsOrgElement.left;
64
+ widthOrgElement = orgElement.css('width');
65
 
66
+ $('.cloned').css('left',leftOrgElement+'px').css('top',stickyTop+'px').css('width',widthOrgElement).show();
67
  $('.original').css('visibility','hidden');
68
  } else {
69
  // not scrolled past the menu; only show the original menu.
assets/js/jq-sticky-anything.min.js CHANGED
@@ -1,5 +1,4 @@
1
  /**
2
- * @preserve Sticky Anything 1.1.2 | @senff | GPL2 Licensed
3
  */
4
-
5
- (function(e){function t(t,n,r){var i=e(".original").offset();orgElementTop=i.top;var s=window,o="inner";if(!("innerWidth"in window)){o="client";s=document.documentElement||document.body}viewport=s[o+"Width"];if(e(window).scrollTop()>=orgElementTop-t&&viewport>=n&&viewport<=r){orgElement=e(".original");coordsOrgElement=orgElement.offset();leftOrgElement=coordsOrgElement.left;widthOrgElement=orgElement.outerWidth();e(".cloned").css("left",leftOrgElement+"px").css("top",t+"px").css("width",widthOrgElement+"px").show();e(".original").css("visibility","hidden")}else{e(".cloned").hide();e(".original").css("visibility","visible")}}e.fn.stickThis=function(n){var r=e.extend({top:0,minscreenwidth:0,maxscreenwidth:99999,zindex:1,debugmode:false},n);var i=e(this).length;if(i<1){if(r.debugmode==true){console.error("STICKY ANYTHING DEBUG: There are no elements with the selector/class/ID you selected.")}}else if(i>1){if(r.debugmode==true){console.error("STICKY ANYTHING DEBUG: There is more than one element with the selector/class/ID you selected. You can only make ONE element sticky.")}}else{e(this).addClass("original").clone().insertAfter(this).addClass("cloned").css("position","fixed").css("top",r.top+"px").css("margin-top","0").css("margin-left","0").css("z-index",r.zindex).removeClass("original").hide();checkElement=setInterval(function(){t(r.top,r.minscreenwidth,r.maxscreenwidth)},10)}return this}})(jQuery)
1
  /**
2
+ * @preserve Sticky Anything 1.1.3 | @senff | GPL2 Licensed
3
  */
4
+ (function(e){function t(t,n,r){var i=e(".original").offset();orgElementTop=i.top;var s=window,o="inner";if(!("innerWidth"in window)){o="client";s=document.documentElement||document.body}viewport=s[o+"Width"];if(e(window).scrollTop()>=orgElementTop-t&&viewport>=n&&viewport<=r){orgElement=e(".original");coordsOrgElement=orgElement.offset();leftOrgElement=coordsOrgElement.left;widthOrgElement=orgElement.css("width");e(".cloned").css("left",leftOrgElement+"px").css("top",t+"px").css("width",widthOrgElement).show();e(".original").css("visibility","hidden")}else{e(".cloned").hide();e(".original").css("visibility","visible")}}e.fn.stickThis=function(n){var r=e.extend({top:0,minscreenwidth:0,maxscreenwidth:99999,zindex:1,debugmode:false},n);var i=e(this).length;if(i<1){if(r.debugmode==true){console.error("STICKY ANYTHING DEBUG: There are no elements with the selector/class/ID you selected.")}}else if(i>1){if(r.debugmode==true){console.error("STICKY ANYTHING DEBUG: There is more than one element with the selector/class/ID you selected. You can only make ONE element sticky.")}}else{e(this).addClass("original").clone().insertAfter(this).addClass("cloned").css("position","fixed").css("top",r.top+"px").css("margin-top","0").css("margin-left","0").css("z-index",r.zindex).removeClass("original").hide();checkElement=setInterval(function(){t(r.top,r.minscreenwidth,r.maxscreenwidth)},10)}return this}})(jQuery)
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: plugin, sticky, menu, scroll, element
4
  Plugin URI: http://www.senff.com/plugins/sticky-anything-wp
5
  Requires at least: 3.6
6
  Tested up to: 4.0
7
- Stable tag: 1.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -59,6 +59,9 @@ For any other issues, please use the [WordPress.org forum](https://wordpress.org
59
 
60
  == Changelog ==
61
 
 
 
 
62
  = 1.1.2 =
63
  * Fixes element width calculation bug.
64
 
@@ -66,14 +69,17 @@ For any other issues, please use the [WordPress.org forum](https://wordpress.org
66
  * Fixes viewport calculation bug.
67
 
68
  = 1.1 =
69
- * Added functionality for optional minimum/maximum screen size
70
 
71
  = 1.0 =
72
- * initial release (using v1.1 of the standalone jQuery plugin)
73
 
74
 
75
  == Upgrade Notice ==
76
 
 
 
 
77
  = 1.1.2 =
78
  Fixes element width calculation bug.
79
 
@@ -84,4 +90,4 @@ Fixes viewport calculation bug.
84
  Added functionality: you can now set a minimum and/or maximum screen size where the element should be sticky (handy for responsive designs, should you not want your element to be sticky below or above certain screen sizes).
85
 
86
  = 1.0 =
87
- Initial release of the plugin
4
  Plugin URI: http://www.senff.com/plugins/sticky-anything-wp
5
  Requires at least: 3.6
6
  Tested up to: 4.0
7
+ Stable tag: 1.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
59
 
60
  == Changelog ==
61
 
62
+ = 1.1.3 =
63
+ * Fixes width calculation bug introduced in previous version (sorry about that), box sizing now supported.
64
+
65
  = 1.1.2 =
66
  * Fixes element width calculation bug.
67
 
69
  * Fixes viewport calculation bug.
70
 
71
  = 1.1 =
72
+ * Added functionality for optional minimum/maximum screen size.
73
 
74
  = 1.0 =
75
+ * Initial release (using v1.1 of the standalone jQuery plugin).
76
 
77
 
78
  == Upgrade Notice ==
79
 
80
+ = 1.1.3 =
81
+ * Fixes width calculation bug introduced in previous version (sorry about that), box sizing now supported.
82
+
83
  = 1.1.2 =
84
  Fixes element width calculation bug.
85
 
90
  Added functionality: you can now set a minimum and/or maximum screen size where the element should be sticky (handy for responsive designs, should you not want your element to be sticky below or above certain screen sizes).
91
 
92
  = 1.0 =
93
+ Initial release of the plugin.
sticky-menu-or-anything.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.senff.com/plugins/sticky-anything-wp
5
  Description: Pick any element on your page, and it will stick when it reaches the top of the page when you scroll down. Usually handy for navigation menus, but can be used for any (unique) element on your page.
6
  Author: Mark Senff
7
  Author URI: http://www.senff.com
8
- Version: 1.1.2
9
  */
10
 
11
  defined('ABSPATH') or die('Gorgonzola. Wow, BOB, wow.');
@@ -15,7 +15,7 @@ defined('ABSPATH') or die('Gorgonzola. Wow, BOB, wow.');
15
 
16
  if (!function_exists('sticky_anthing_default_options')) {
17
  function sticky_anthing_default_options() {
18
- $versionNum = '1.1.2';
19
  if (get_option('sticky_anything_options') === false) {
20
  $new_options['sa_version'] = $versionNum;
21
  $new_options['sa_element'] = '';
@@ -31,7 +31,7 @@ if (!function_exists('sticky_anthing_default_options')) {
31
 
32
  if (!function_exists('sticky_anything_update')) {
33
  function sticky_anything_update() {
34
- $versionNum = '1.1.2';
35
  $existing_options = get_option('sticky_anything_options');
36
 
37
  if(!isset($existing_options['sa_minscreenwidth'])) {
@@ -213,14 +213,14 @@ if (!function_exists('sticky_anything_config_page')) {
213
  </tr>
214
 
215
  <tr>
216
- <th scope="row">Element should not be sticky when screen smaller than: (optional) <a href="#" title="Sometimes you do not want your element to be sticky when your screen is small (responsive menus, etc). If you enter a value here, your menu will not be sticky when your screen width is smaller than this value." class="help">?</a></th>
217
  <td>
218
  <input type="number" id="sa_minscreenwidth" name="sa_minscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_minscreenwidth'] ); ?>" style="width:80px;" /> pixels
219
  </td>
220
  </tr>
221
 
222
  <tr>
223
- <th scope="row">Element should not be sticky when screen larger than: (optional) <a href="#" title="Sometimes you do not want your element to be sticky when your screen is large (responsive menus, etc). If you enter a value here, your menu will not be sticky when your screen width is wider than this value." class="help">?</a></th>
224
  <td>
225
  <input type="number" id="sa_maxscreenwidth" name="sa_maxscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_maxscreenwidth'] ); ?>" style="width:80px;" /> pixels
226
  </td>
@@ -255,7 +255,7 @@ if (!function_exists('sticky_anything_config_page')) {
255
 
256
  <hr />
257
 
258
- <p><a href="http://www.senff.com/plugins/sticky-anything-wp" target="_blank">Sticky Menu (or Anything!) on Scroll</a> version 1.1 by <a href="http://www.senff.com" target="_blank">Senff</a> &nbsp;/&nbsp; <a href="http://www.senff.com/contact" target="_blank">Please Report Bugs</a> &nbsp;/&nbsp; Follow on Twitter: <a href="http://www.twitter.com/senff" target="_blank">@Senff</a> &nbsp;/&nbsp; <a href="http://www.senff.com/plugins/sticky-anything-wp" target="_blank">Detailed documentation</a> &nbsp;/&nbsp; <a href="http://www.senff.com/plugins/sticky-anything" target="_blank">Non-WP jQuery plugin</a></p>
259
 
260
  </div>
261
 
5
  Description: Pick any element on your page, and it will stick when it reaches the top of the page when you scroll down. Usually handy for navigation menus, but can be used for any (unique) element on your page.
6
  Author: Mark Senff
7
  Author URI: http://www.senff.com
8
+ Version: 1.1.3
9
  */
10
 
11
  defined('ABSPATH') or die('Gorgonzola. Wow, BOB, wow.');
15
 
16
  if (!function_exists('sticky_anthing_default_options')) {
17
  function sticky_anthing_default_options() {
18
+ $versionNum = '1.1.3';
19
  if (get_option('sticky_anything_options') === false) {
20
  $new_options['sa_version'] = $versionNum;
21
  $new_options['sa_element'] = '';
31
 
32
  if (!function_exists('sticky_anything_update')) {
33
  function sticky_anything_update() {
34
+ $versionNum = '1.1.3';
35
  $existing_options = get_option('sticky_anything_options');
36
 
37
  if(!isset($existing_options['sa_minscreenwidth'])) {
213
  </tr>
214
 
215
  <tr>
216
+ <th scope="row">Do not stick element when screen smaller than: (optional) <a href="#" title="Sometimes you do not want your element to be sticky when your screen is small (responsive menus, etc). If you enter a value here, your menu will not be sticky when your screen width is smaller than this value." class="help">?</a></th>
217
  <td>
218
  <input type="number" id="sa_minscreenwidth" name="sa_minscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_minscreenwidth'] ); ?>" style="width:80px;" /> pixels
219
  </td>
220
  </tr>
221
 
222
  <tr>
223
+ <th scope="row">Do not stick element when screen larger than: (optional) <a href="#" title="Sometimes you do not want your element to be sticky when your screen is large (responsive menus, etc). If you enter a value here, your menu will not be sticky when your screen width is wider than this value." class="help">?</a></th>
224
  <td>
225
  <input type="number" id="sa_maxscreenwidth" name="sa_maxscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_maxscreenwidth'] ); ?>" style="width:80px;" /> pixels
226
  </td>
255
 
256
  <hr />
257
 
258
+ <p><a href="http://www.senff.com/plugins/sticky-anything-wp" target="_blank">Sticky Menu (or Anything!) on Scroll</a> version 1.1.3 by <a href="http://www.senff.com" target="_blank">Senff</a> &nbsp;/&nbsp; <a href="http://www.senff.com/contact" target="_blank">Please Report Bugs</a> &nbsp;/&nbsp; Follow on Twitter: <a href="http://www.twitter.com/senff" target="_blank">@Senff</a> &nbsp;/&nbsp; <a href="http://www.senff.com/plugins/sticky-anything-wp" target="_blank">Detailed documentation</a> &nbsp;/&nbsp; <a href="http://www.senff.com/plugins/sticky-anything" target="_blank">Non-WP jQuery plugin</a></p>
259
 
260
  </div>
261