L
L
Lorem Ipsum2017-07-15 19:00:58
css
Lorem Ipsum, 2017-07-15 19:00:58

Page jumps to the top with Fancybox 3?

Hi everybody! Connected fancybox 3 for modals. On opening the page jumps to the top, on closing it jumps back to the link. Found a solution from a previous version of Fancybox, didn't help
Old solution:

html {
  font-size: 100%; 
  overflow-y: scroll; 
  -webkit-text-size-adjust: 100%; 
  -ms-text-size-adjust: 100%;
}

$('.image').fancybox({
  padding: 0,
  helpers: {
    overlay: {
      locked: false
    }
  }
});

I do not know where to dig. Maybe someone similar?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Pushkarev, 2017-07-15
@AXP-dev

There was such a problem due to the fact that the content went beyond the container. I set overflow for these blocks and the problem was solved (it was on a fixed layout, it's always good with adaptive)

E
Eugene, 2017-07-17
@Eugeny1987

html probably has height: 100%

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question