You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this fantastic plugin for my responsive layout, where a "mobile first" approach has been adopted.
So, I have a navigation element that has no css properties in "mobile" mediaqueries breakpoint and then it moves left and positioned fixed on "desktop" mediaqueries breakpoint.
So I used the 'minWidth' settings to remove 'scrollToFixed' stuff on this element for mobile mediaqueries (min-width < 768px), in this way:
Hi all,
I'm using this fantastic plugin for my responsive layout, where a "mobile first" approach has been adopted.
So, I have a navigation element that has no css properties in "mobile" mediaqueries breakpoint and then it moves left and positioned fixed on "desktop" mediaqueries breakpoint.
So I used the 'minWidth' settings to remove 'scrollToFixed' stuff on this element for mobile mediaqueries (min-width < 768px), in this way:
$('#header-main').scrollToFixed({$('#footer-main').offset().top - $ ('#header-main').outerHeight(true) - 20;
marginTop: 30,
limit: function() {
var limit =
return limit;
},
zIndex: 10,
minWidth:768
});
The problem is that the above approach doesn't works well due this piece of code in setUnfixed function:
// Remove the style attributes that were added to the target.
// This will reverse the target back to the its original style.
target.css({
'width' : '',
'position' : originalPosition,
'left' : '',
'top' : originalOffset.top,
'margin-left' : ''
});
the above code writes inline css in my element that originally it doesn't have.
The result is a broken layout.
SOLUTION:
Changing the above code with:
target.removeAttr('style');
ALL WORKS FINE because all additional inline style is completely removed from my element and it really returns to its original condition.
Could you guys upgrade this plugin to reflect all the above stuff?
Thank you very much
MXT
The text was updated successfully, but these errors were encountered: