hello
Guys,
We used
to face many of issues regarding Sticky side bar, Scroll when side bar is
sticky etc kind of requirements, So I have found very easy stuffs by using
which you guys can easily integrate it, If you still have any issues while
using it, Please let me know, will defiantly help you!
You dont have to applu any Css or extra js for it
You dont have to applu any Css or extra js for it
jQuery to
include:
- http://bigspotteddog.github.io/ScrollToFixed/jquery-scrolltofixed-min.js
- Things to remember : You must include jQuery library(<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>) before including " jquery-scrolltofixed-min.js "
uses:
go
through http://bigspotteddog.github.io/ScrollToFixed/
main
code snippet:
var
summaries = $('.summary');
summaries.each(function(i) {
var summary = $(summaries[i]);
var next = summaries[i + 1];
summary.scrollToFixed({
marginTop: $('.header').outerHeight(true) + 10,
limit: function() {
var limit = 0;
if (next) {
limit = $(next).offset().top - $(this).outerHeight(true) - 10;
} else {
limit = $('.footer').offset().top - $(this).outerHeight(true) - 10;
}
return limit;
},
zIndex: 999
});
});
header – would be your wrapper class according to which you
can make sticky side bar (Header part should not be scrolled)
summery – would be wrapper class which you want to make
sticky
footer – would be your wrapper class , once it’s been
scrolled up, your summery class will not have sticky functionality
Thank You,
Aptechy
No comments:
Post a Comment