Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinitialization #68

Open
baksys opened this issue Nov 20, 2017 · 1 comment
Open

Reinitialization #68

baksys opened this issue Nov 20, 2017 · 1 comment

Comments

@baksys
Copy link

baksys commented Nov 20, 2017

Hello,

I would like to know what would be the best way to reinitialize script after an AJAX call. I have post items, each in

container with data-color attribute. I use jquery.inview to change body background color:

$('article').on('inview', function(event, isInView) {
  if (isInView) {
    var spalva = $(this).attr('data-color');
    $('body').css('background-color', spalva);
  }
});

However, after and AJAX call this script only works with posts displayed on page load. Therefore I need to reinitialize jquery.inview after the call. I would be very grateful if someone could help me what would be the best way to do it.

@skillmatic-co
Copy link

Also having this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants