Changeset 1377742
- Timestamp:
- 03/24/2016 09:38:11 AM (10 years ago)
- Location:
- fixed-menu-anchor/trunk
- Files:
-
- 3 edited
-
fixed-menu-anchor.php (modified) (2 diffs)
-
js/fixed-menu-anchor.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
fixed-menu-anchor/trunk/fixed-menu-anchor.php
r1373147 r1377742 8 8 * Plugin Name: Fixed Menu Anchor 9 9 * Plugin URI: https://wordpress.org/plugins/fixed-menu-anchor 10 * Version: 2.0. 310 * Version: 2.0.4 11 11 * Description: Having problems with a fixed header/menu which overlaps the target of an anchor? Use this plugin to jump just before the target so that the fixed header/menu does not overlap anymore. 12 12 * Author: Konrad Abicht, Marc Sauerwald … … 18 18 19 19 if (!defined('FIXEDMENUANCHOR_VERSION')) { 20 define('FIXEDMENUANCHOR_VERSION', '2.0. 3');20 define('FIXEDMENUANCHOR_VERSION', '2.0.4'); 21 21 } 22 22 -
fixed-menu-anchor/trunk/js/fixed-menu-anchor.js
r1368514 r1377742 2 2 * That file is part of the fixed-menu-anchor plugin. 3 3 */ 4 jQuery(document).ready(function(){ 5 // dive into click events for anchors 6 jQuery('a[href*=#]').click(function(e){ 4 if (typeof jQuery != 'undefined') { 5 jQuery(document).ready(function(){ 6 // dive into click events for anchors 7 jQuery('a[href*=#]').click(function(e){ 7 8 8 // stop execution in case, the user wants to ignore elements with a certain 9 // CSS class. 10 if (jQuery(this).hasClass(fixedMenuAnchorCssClassesToBeIgnored)) { 11 return; 12 } 9 // stop execution in case, the user wants to ignore elements with a certain 10 // CSS class. 11 if (jQuery(this).hasClass(fixedMenuAnchorCssClassesToBeIgnored) 12 && '' != fixedMenuAnchorCssClassesToBeIgnored) { 13 return; 14 } 13 15 14 // get top-left position of the target element on the screen15 var top = fixedMenuAnchor_getTopValueOfAnchorTarget(jQuery, this);16 // get top-left position of the target element on the screen 17 var top = fixedMenuAnchor_getTopValueOfAnchorTarget(jQuery, this); 16 18 17 // get distance(user defined) between anchor-target and screen-top.18 var distance = fixedMenuAnchor_getDistance(window.innerWidth);19 // get distance(user defined) between anchor-target and screen-top. 20 var distance = fixedMenuAnchor_getDistance(window.innerWidth); 19 21 20 // move the screen to the top coordinate minus the user given distance 21 jQuery('html, body').animate({scrollTop: top - distance}, 500); 22 // move the screen to the top coordinate minus the user given distance 23 jQuery('html, body').animate({scrollTop: top - distance}, 500); 24 }); 22 25 }); 23 }); 26 } else { 27 console.log('jQuery is not loaded therefore the Fixed Menu Anchor plugin was set inactive.'); 28 } 24 29 25 30 /** -
fixed-menu-anchor/trunk/readme.txt
r1373120 r1377742 60 60 == Changelog == 61 61 62 = 2.0.1 - 2.0.4= 63 * Bug fixing 64 * removed unneccessary files (e.g. documentation of used vendors) 65 62 66 = 2.0.0 = 63 67 * Added new features: 64 68 * you can now define a maximum viewport width until a certain distance is to be used (only pro version). 65 69 * you can define a certain CSS-class, when it is attached on a link, the click event will be ignored 70 * implemented test environment on PHP and JavaScript level to improve stability and reduce bugs 66 71 * tested plugin if compatible with standard theme of WordPress 4.4.2 67 72 * added shortcut in plugin view to reach settings page faster after activation
Note: See TracChangeset
for help on using the changeset viewer.