Topic: unsticky
usmanadnan001
pro asked 8 years ago
Mirosław Stasiak
answered 8 years ago
You can do it in two ways:
//It stops after a certain number of pixels 'stopper'
$("#header").sticky({
zIndex:3,
stopper: 300
});
//stopper is an element which stop the StickyContent.
$(".sticky").sticky({
topSpacing: 58,
zIndex:2,
stopper: "#footer"
});
usmanadnan001 pro commented 8 years ago
i want to unstick the element after an ajax call (not scrolling)
Mirosław Stasiak
answered 8 years ago
If you want to unstick element after the ajax response, just in the done function you can remove from this element class '.sticky' and add a stopper.
But after this, you need to scroll page to see effect
$.ajax({
url : '/url',
method : 'POST',
dataType : 'json',
contentType: 'application/json',
data : JSON.stringify(data)
}).done(function(response){
$("#sticky-element").sticky({
stopper: 0
});
$('#sticky-element').removeClass();
}
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Mirosław Stasiak commented 8 years ago
What element do you want to unstick? Tell me more details.usmanadnan001 pro commented 8 years ago
stickycontent