Scrolling iframe on iOS is solved, BUT the iframe page display incomplete

后端 未结 4 640
无人共我
无人共我 2021-02-06 09:24

I am trying to scroll an iframe on iOS, and I succeeded, it\'s scrolling well, reference:

http://home.jejaju.com/play/iframe-scroll.html

http://areaaperta.com/ni

4条回答
  •  甜味超标
    2021-02-06 10:08

    I found a combination of div with "absolute" style and nicescroll do fix choppines.

    You have to load nicescroll on the page loaded by iframe. In the same page wrap all you content with a div (with style absolute)

      #content {   position:absolute; }
    

    Load nicescroll using wrapped div content.

      $(document).ready(function() {
        $("html").niceScroll("#content"); 
      });
    

    Link to demo page, so you can check the code: http://areaaperta.com/nicescroll/demo/iframe6.html

    Automatically, with iOS native scroll has used, in other platform you got nicescroll active.

    I have test on iPad with iOS 5.1.

提交回复
热议问题