usmanadnan001 pro asked 7 years ago


how can i unstick an element?

Mirosław Stasiak free commented 7 years ago

What element do you want to unstick? Tell me more details.

usmanadnan001 pro commented 7 years ago

stickycontent

Mirosław Stasiak free answered 7 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();
      }

Mirosław Stasiak free answered 7 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 7 years ago

i want to unstick the element after an ajax call (not scrolling)


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags