Skip to content

click don't work after JScrollPane and Ajax #379

@joelmatisa

Description

@joelmatisa

Good morning all,
I don't know if it's me but I noticed some pretty weird behavior, when I fetch the data via ajax and I made a plugin call: $ ('. Scroll-user-table'). JScrollPane ( {
showArrows: true,
hijackInternalLinks: true,
autoReset: true,
horizontalArrowPositions: 'after',
});
After there is a jump when I try to click on an element of the content taken via ajax
It works when I click for the second time

script:

 function siteScrollPage() {
    $('.scroll-user-table').jScrollPane({
       showArrows: true,
      hijackInternalLinks: true,
      autoReinitialise: true,
      horizontalArrowPositions: 'after',
    });
};

 loader.removeClass('hidden');

  $.ajax({
    url: '',
    type: 'GET',
    data: {loaded: 'loaded'},
  })
  .done(function(response) {
    firstLoaded = false;
    $('#add-loaded-invoice').html(response);
  })
  .fail(function(response) {
  })
  .always(function(response) {
    siteScrollPage();
    siteUserPaginate();
    siteFirstTimeLoadedInvoiceLivraison();
    loader.addClass('hidden');
  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions