0

i hav a javascript for autoplay a youtube a javascript ist in file1.js and Jetpack infninity scroll file2.js the file 1 work only in the posts thej ar not from infinity scroll and at the posts thej ar loaded from jetpack infinity scroll don't work i tray a lot of posibilitys i tray to load the javascript with infnity scroll agen to the header but thets dont work to replace the js at the header thets wont work i don't know what can i do more. i nead a stacoverflow people help i am sory my english is not so good and i am new in javascript world

FILE1

window.onload = function ani2() {
  var LoadVideo = function (player_id) {

    var Program = {

      Init: function () {
        this.NewPlayer();
        this.EventHandler();
      },

      NewPlayer: function () {
        var _this = this;
        this.Player = new YT.Player(player_id, {
          events: {
            'onStateChange': onPlayerStateChange,
          }


        });
        _this.Player.$element = $('#' + player_id);
      }
    }
  }
}

FILE 2

thets the file from wher play the jetpack infinity scroll

if (type == 'click') {

  if (response.lastbatch) {

    if (self.click_handle) {

      $('#infinite-handle').remove();
      // Update body classes
      self.body.addClass('infinity-end').removeClass('infinity-success');

    } else {
      self.body.trigger('infinite-scroll-posts-end');

    }
  } else {

    if (self.click_handle) {
      self.element.append(self.handle);
    } else {

      self.body.trigger('infinite-scroll-posts-more');
    }
  }
} else if (response.lastbatch) {

  self.disabled = true;
  self.body.addClass('infinity-end').removeClass('infinity-success');
}
Kenji Mukai
  • 599
  • 4
  • 8
d00nn1234
  • 27
  • 5
  • We just can't understand your problem. Maybe you can use an another helping plateform in your language – Paul Oct 09 '17 at 13:58
  • the problem is the javascript from file1 don'T work at all posts thej are loaded from jetpack infinity scroll – d00nn1234 Oct 09 '17 at 13:59
  • Use another scroll plugin so – Paul Oct 09 '17 at 13:59
  • i tray a lot WP infnity scroll and YITH Infinity scroll but at another plugins ar the same problem – d00nn1234 Oct 09 '17 at 14:00
  • Try to deactivate ALL your plugins first, install a standard wordpress template, and active one of your plugin infinite scroll. – Paul Oct 09 '17 at 14:04
  • i delete all the wordpress bicos it was a new wordpress and reinstall simple teme and jetpack infinity scroll and this javascript the problem is the infinity scrolldont run the javascript from fil1.js at the new loaded post thets the problem – d00nn1234 Oct 09 '17 at 14:06

0 Answers0