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

Version Description

  • Fixes element width calculation bug.
Download this release

Release Info

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

Code changes from version 1.1.1 to 1.1.2

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.1
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.1
63
  * Fixes viewport calculation bug
64
 
@@ -71,6 +74,9 @@ For any other issues, please use the [WordPress.org forum](https://wordpress.org
71
 
72
  ## Upgrade Notice
73
 
 
 
 
74
  ### 1.1.1
75
  Fixes viewport calculation bug.
76
 
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
 
60
  ## Changelog
61
 
62
+ ### 1.1.2
63
+ * Fixes element width calculation bug
64
+
65
  ### 1.1.1
66
  * Fixes viewport calculation bug
67
 
74
 
75
  ## Upgrade Notice
76
 
77
+ ### 1.1.2
78
+ Fixes element width calculation bug.
79
+
80
  ### 1.1.1
81
  Fixes viewport calculation bug.
82
 
assets/js/jq-sticky-anything.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * @preserve Sticky Anything 1.1.1 | @senff | GPL2 Licensed
3
  */
4
 
5
  (function ($) {
@@ -61,7 +61,7 @@ function stickIt(stickyTop,minwidth,maxwidth) {
61
  orgElement = $('.original');
62
  coordsOrgElement = orgElement.offset();
63
  leftOrgElement = coordsOrgElement.left;
64
- widthOrgElement = orgElement.width();
65
 
66
  $('.cloned').css('left',leftOrgElement+'px').css('top',stickyTop+'px').css('width',widthOrgElement+'px').show();
67
  $('.original').css('visibility','hidden');
1
  /**
2
+ * @preserve Sticky Anything 1.1.2 | @senff | GPL2 Licensed
3
  */
4
 
5
  (function ($) {
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');
assets/js/jq-sticky-anything.min.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * @preserve Sticky Anything 1.1.1 | @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.width();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.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)
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.1
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.1 =
63
  * Fixes viewport calculation bug.
64
 
@@ -71,6 +74,9 @@ For any other issues, please use the [WordPress.org forum](https://wordpress.org
71
 
72
  == Upgrade Notice ==
73
 
 
 
 
74
  = 1.1.1 =
75
  Fixes viewport calculation bug.
76
 
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
 
60
  == Changelog ==
61
 
62
+ = 1.1.2 =
63
+ * Fixes element width calculation bug.
64
+
65
  = 1.1.1 =
66
  * Fixes viewport calculation bug.
67
 
74
 
75
  == Upgrade Notice ==
76
 
77
+ = 1.1.2 =
78
+ Fixes element width calculation bug.
79
+
80
  = 1.1.1 =
81
  Fixes viewport calculation bug.
82
 
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.1
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.1';
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.1';
35
  $existing_options = get_option('sticky_anything_options');
36
 
37
  if(!isset($existing_options['sa_minscreenwidth'])) {
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
 
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
 
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'])) {