Skip to content

Commit

Permalink
Fix scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Jun 14, 2024
1 parent ce784fe commit d86dca5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plugin/YouPHPFlix2/view/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ function startModeFlix(container) {
if ($('#poster' + crc).is(":hidden")) {
$('#poster' + crc).css('background-image', 'url(' + $('#poster' + crc).attr('poster') + ')');
$('#poster' + crc).slideDown('fast', function () {
var top = row.offset().top;
$('html, body').animate({
scrollTop: top - myEleTop
}, 'fast');
console.log('#poster' + crc+' slideDown');
setTimeout(() => {
var top = row.offset().top;
console.log('#poster' + crc+' row.offset().top', top, myEleTop, top - myEleTop);
$('html, body').animate({
scrollTop: top - myEleTop
}, 'fast');
}, 500);
});
} else {
if ($(this).closest('.flickity-area').length) {
Expand Down

0 comments on commit d86dca5

Please sign in to comment.