search

Home  >  Q&A  >  body text

angular.js - After sliding the page in the ionic project, the $anchorscroll anchor point jump cannot jump on ios.

Based on # being used as a path in the ionic project, $anchorscroll is used for the anchor jump function within the page. The following is the main code used
$location.hash(id);
$anchorScroll();

The operations performed are:
【1】Don't slide the page first, click the button directly to trigger the jump to the corresponding id, and try to see if you can manually slide the page after jumping
【2】Slide the page first, and then Click the button to trigger the jump event and see if it can jump
[3] Slide the page first, then click the button to trigger the jump event. After the successful jump, try to see if you can manually slide the page

On Android, all these operations are possible. On iPad, the second and third operations are invalid. Moreover, after the first jump is successful, the page cannot slide up and only slides down

仅有的幸福仅有的幸福2790 days ago982

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-05-15 17:14:41

    After searching thousands of Baidu, I finally found the answer:
    Just add: overflow-scroll="true" to ion-content
    That is: <ion-content overflow-scroll="true">

    reply
    0
  • Cancelreply