js/foundation/foundation.magellan.js in zurb-foundation-4.2.1 vs js/foundation/foundation.magellan.js in zurb-foundation-4.2.2
- old
+ new
@@ -4,11 +4,11 @@
'use strict';
Foundation.libs.magellan = {
name : 'magellan',
- version : '4.2.0',
+ version : '4.2.2',
settings : {
activeClass: 'active'
},
@@ -18,11 +18,11 @@
if (typeof method === 'object') {
$.extend(true, this.settings, method);
}
- if (typeof method != 'string') {
+ if (typeof method !== 'string') {
if (!this.settings.init) {
this.fixed_magellan = $("[data-magellan-expedition]");
this.set_threshold();
this.last_destination = $('[data-magellan-destination]').last();
this.events();
@@ -77,11 +77,13 @@
var attr = $expedition.attr('data-magellan-top-offset');
if ($expedition.data("magellan-fixed-position") != fixed_position) {
$expedition.data("magellan-fixed-position", fixed_position);
if (fixed_position) {
+ $expedition.addClass('fixed');
$expedition.css({position:"fixed", top:0});
} else {
+ $expedition.removeClass('fixed');
$expedition.css({position:"", top:""});
}
if (fixed_position && typeof attr != 'undefined' && attr != false) {
$expedition.css({position:"fixed", top:attr + "px"});
}
\ No newline at end of file