0

I am doing a popup light box by using the code I found in this article HTML / CSS Popup div on text click.

Now I am trying to disable the main scrolling of the page, since the light box has a fixed height, but certain pages are longer then the popup which leads to scrolling the background of the popup which in this case is the page itself.

I played a bit with overflow but without success.

Community
  • 1
  • 1
Nec
  • 178
  • 2
  • 16

1 Answers1

3

Try the following CSS:

html {
  height: 100%;
  overflow: hidden;
}

Also, if you trigger this code on a random location in the page, you might need to do extra work.

Do you have a jsfiddle or codepen?

Guido Bouman
  • 3,155
  • 4
  • 22
  • 33
  • sadly none of the above, but since its wordpress it will go straight to page template – Nec Mar 27 '15 at 13:32
  • the thing im trying to do is like here https://www.lush.co.uk/ just click the upperleft speechbubble – Nec Mar 27 '15 at 13:33
  • I can't write the whole layout for you. You need to give me something to work with. Do you have a live url where I can view actual code? Or can you copy-paste code in? Code that you're actually using. – Guido Bouman Mar 27 '15 at 13:36
  • sadly using localhost, but your and nikolays replyes gave me something to work on . thank you both :) – Nec Mar 27 '15 at 13:39
  • If your question is answered, you should mark one of the answers as the correct one. ;) – Guido Bouman Mar 27 '15 at 13:43
  • srry new here , still getting used to this , thanks :) – Nec Mar 27 '15 at 13:57