myStickymenu - Version 1.8.3

Version Description

Download this release

Release Info

Developer damiroquai
Plugin Icon 128x128 myStickymenu
Version 1.8.3
Comparing to
See all releases

Code changes from version 1.8.2 to 1.8.3

Files changed (4) hide show
  1. js/mystickymenu.js +10 -0
  2. js/mystickymenu.min.js +1 -1
  3. mystickymenu.php +1 -1
  4. readme.txt +2 -2
js/mystickymenu.js CHANGED
@@ -45,4 +45,14 @@ var y = hasScrollY ? window.scrollY : document.documentElement.scrollTop;
45
}
46
47
document.addEventListener('scroll', onScroll);
48
};
45
}
46
47
document.addEventListener('scroll', onScroll);
48
+
49
+ function OnResizeDocument () {
50
+ mysticky_navbar.style.removeProperty("width");
51
+ mysticky_navbar.classList.remove('myfixed');
52
+ wrappernav.classList.remove('wrapfixed');
53
+ wrappermysticky.style.removeProperty("width");
54
+ parentnav.style.removeProperty("height");
55
+ }
56
+
57
+ window.addEventListener('resize', OnResizeDocument);
58
};
js/mystickymenu.min.js CHANGED
@@ -1 +1 @@
1
- var myfixed_disable_small=parseInt(mysticky_name.mysticky_disable_at_width_string);var mybodyWidth=parseInt(document.body.clientWidth);if(mybodyWidth>=myfixed_disable_small){var mysticky_navbar=document.querySelector(mysticky_name.mysticky_string);var parentmysticky=mysticky_navbar.parentNode;var wrappermysticky=document.createElement("div");var position=0;for(var i=0;i<parentmysticky.childNodes.length;i++){if(parentmysticky.childNodes[i]==mysticky_navbar){position=i;break}}wrappermysticky.id="mysticky-wrap";wrappermysticky.appendChild(mysticky_navbar);parentmysticky.insertBefore(wrappermysticky,parentmysticky.childNodes[position]);var parentnav=mysticky_navbar.parentNode;var wrappernav=document.createElement("div");wrappernav.id="mysticky-nav";parentnav.replaceChild(wrappernav,mysticky_navbar);wrappernav.appendChild(mysticky_navbar);var mysticky_active_on_height=parseInt(mysticky_name.mysticky_active_on_height_string);var origOffsetY=mysticky_active_on_height;var mydivHeight=mysticky_navbar.offsetHeight+"px";var hasScrollY="scrollY"in window;function onScroll(e){var t=mysticky_navbar.offsetWidth+"px";var n="";var r=hasScrollY?window.scrollY:document.documentElement.scrollTop;r>=origOffsetY?mysticky_navbar.classList.add("myfixed"):mysticky_navbar.classList.remove("myfixed");r>=origOffsetY?wrappernav.classList.add("wrapfixed"):wrappernav.classList.remove("wrapfixed");r>=origOffsetY?mysticky_navbar.style.width=t:mysticky_navbar.style.width=n;r>=origOffsetY?wrappermysticky.style.height=mydivHeight:wrappermysticky.style.height=n}document.addEventListener("scroll",onScroll)}
1
+ function onScroll(e){var t=mysticky_navbar.offsetWidth+"px",i="",a=hasScrollY?window.scrollY:document.documentElement.scrollTop;a>=origOffsetY?mysticky_navbar.classList.add("myfixed"):mysticky_navbar.classList.remove("myfixed"),a>=origOffsetY?wrappernav.classList.add("wrapfixed"):wrappernav.classList.remove("wrapfixed"),a>=origOffsetY?mysticky_navbar.style.width=t:mysticky_navbar.style.width=i,a>=origOffsetY?wrappermysticky.style.height=mydivHeight:wrappermysticky.style.height=i}function OnResizeDocument(){mysticky_navbar.style.removeProperty("width"),mysticky_navbar.classList.remove("myfixed"),wrappernav.classList.remove("wrapfixed"),wrappermysticky.style.removeProperty("width"),parentnav.style.removeProperty("height")}var myfixed_disable_small=parseInt(mysticky_name.mysticky_disable_at_width_string),mybodyWidth=parseInt(document.body.clientWidth);if(mybodyWidth>=myfixed_disable_small){for(var mysticky_navbar=document.querySelector(mysticky_name.mysticky_string),parentmysticky=mysticky_navbar.parentNode,wrappermysticky=document.createElement("div"),position=0,i=0;i<parentmysticky.childNodes.length;i++)if(parentmysticky.childNodes[i]==mysticky_navbar){position=i;break}wrappermysticky.id="mysticky-wrap",wrappermysticky.appendChild(mysticky_navbar),parentmysticky.insertBefore(wrappermysticky,parentmysticky.childNodes[position]);var parentnav=mysticky_navbar.parentNode,wrappernav=document.createElement("div");wrappernav.id="mysticky-nav",parentnav.replaceChild(wrappernav,mysticky_navbar),wrappernav.appendChild(mysticky_navbar);var mysticky_active_on_height=parseInt(mysticky_name.mysticky_active_on_height_string),origOffsetY=mysticky_active_on_height,mydivHeight=mysticky_navbar.offsetHeight+"px",hasScrollY="scrollY"in window;document.addEventListener("scroll",onScroll),window.addEventListener("resize",OnResizeDocument)}
mystickymenu.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: myStickymenu
4
Plugin URI: http://wordpress.transformnews.com/plugins/mystickymenu-simple-sticky-fixed-on-top-menu-implementation-for-twentythirteen-menu-269
5
Description: Simple sticky (fixed on top) menu implementation for default Twentythirteen navigation menu. For other themes, after install go to Settings / myStickymenu and change Sticky Class to .your_navbar_class or #your_navbar_id.
6
- Version: 1.8.2
7
Author: m.r.d.a
8
Text Domain: mystickymenu
9
Domain Path: /languages
3
Plugin Name: myStickymenu
4
Plugin URI: http://wordpress.transformnews.com/plugins/mystickymenu-simple-sticky-fixed-on-top-menu-implementation-for-twentythirteen-menu-269
5
Description: Simple sticky (fixed on top) menu implementation for default Twentythirteen navigation menu. For other themes, after install go to Settings / myStickymenu and change Sticky Class to .your_navbar_class or #your_navbar_id.
6
+ Version: 1.8.3
7
Author: m.r.d.a
8
Text Domain: mystickymenu
9
Domain Path: /languages
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: damiroquai
3
Donate link: http://wordpress.transformnews.com/contact
4
Tags: sticky menu, twentythirteen, twenty-thirteen, plugin, menu, jquery, sticky header, header, sticky, sticky navigation
5
Requires at least: 3.5.1
6
- Tested up to: 4.4
7
- Stable tag: 1.8.2
8
License: GPLv2 or later
9
10
This modern lightweight plugin will made your menu or header sticky on top of page, after desired number of pixels when scrolled.
3
Donate link: http://wordpress.transformnews.com/contact
4
Tags: sticky menu, twentythirteen, twenty-thirteen, plugin, menu, jquery, sticky header, header, sticky, sticky navigation
5
Requires at least: 3.5.1
6
+ Tested up to: 4.8
7
+ Stable tag: 1.8.3
8
License: GPLv2 or later
9
10
This modern lightweight plugin will made your menu or header sticky on top of page, after desired number of pixels when scrolled.