Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).on('click', 'section.sets a.ajax', function() {
- var href = $(this).attr('href');
- $.ajax({
- url: href,
- success: function(data){
- console.log(data);
- $('section.sets div.items').append($(data).find('section.sets div.items').html());
- var href = $(data).find('section.sets a.ajax').attr('href');
- $('section.sets a.ajax').attr('href', href);
- $(window).on('scroll', onScroll);
- }
- });
- history.pushState({}, '', '/lookbook/');
- return false;
- });
- function onScroll(){
- if($(window).scrollTop() + $(window).height() > $(document).height() - 200) {
- $(window).off('scroll');
- $('section.sets a.ajax').trigger('click');
- }
- }
- $(window).scroll(onScroll);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement