user3821727
user3821727

Reputation: 1

Scroll Function When Position is set to Fixed

The scrollbar is missing because I have set the position to fixed. Is there any way of getting the scrollbar back. I have checked numerous solution but none of them work

#OuterGallery {
  position:fixed;
  margin: -6px auto 0px auto;
  width: 100%;
  height: 675px;
} 

Thank you very much for ant help you can provide

Upvotes: 0

Views: 21

Answers (1)

Suraj Rawat
Suraj Rawat

Reputation: 3763

The only way to do this task is via calculating windows height in jquery

live code

  if($('#OuterGallery ').height() >= $(window).height()){
      $('body').css({
      height: $('#OuterGallery ').height() + "px"
  })
  }

Upvotes: 1

Related Questions