1

I am working on jquery popup.

When popup is opened i need to scroll the content into it.

But it is showing problem when i am trying to scroll the content with mouse wheel. It scrolls the background page also. I have used:

 $(window).scroll(function() { return false; }); 

but it stops the scrolling of popup content also and with

 $("body").css("overflow", "hidden");

it hides the scroll from background page. Is there any another way to prevent the background page to scroll?

mTorres
  • 3,590
  • 2
  • 25
  • 36
user3714488
  • 103
  • 1
  • 3
  • 15
  • Duplicate of: http://stackoverflow.com/questions/3656592/how-to-programmatically-disable-page-scrolling-with-jquery – Ganesh Jadhav Jul 15 '14 at 06:15
  • But i am not getting any solution from this. – user3714488 Jul 15 '14 at 06:28
  • I think i missing something but you tried to make the html and the body with 100% height and overflow hidden? I'm confuse with this sentence: "When popup is opened i need to scroll the content into it." If the above didn't help you, could you explain that a little more? – frikinside Jul 15 '14 at 06:38

2 Answers2

0

Try this out

$('body').css("height",$( window ).height());
$('body').css("overflow","hidden");
Zach Saucier
  • 24,871
  • 12
  • 85
  • 147
Nimesh07
  • 362
  • 3
  • 5
0

I found this.Prevent Page behind JQuery UI Dialog from Scrolling. Not tested. http://coding.abel.nu/2013/02/prevent-page-behind-jquery-ui-dialog-from-scrolling/

Abhijith Sasikumar
  • 13,262
  • 4
  • 31
  • 45