小编War*_*rri的帖子

Ionic anchorscroll无法在iOS上运行

我在我的离子应用程序中使用$ anchorscroll,在Android上它运行正常但在iOS上我的内容在滚动后卡住了,我无法向上滚动.

我尝试使用overflow-scroll ="true",但这在我的应用程序中都不起作用...

有人可以帮我这个吗?

function scrollTo() {
    console.log("scroll to: " + $stateParams.id);
    var anchor = '';
    if($stateParams.id === '') {
        console.log("empty");
        anchor = "birthday-test";
    } else {
        console.log("not empty");
        var employee_id = $stateParams.id;
        anchor = "birthday-" + employee_id;
    }
    console.log("anchor : " + anchor);
    $location.hash(anchor);
    $anchorScroll();
}
Run Code Online (Sandbox Code Playgroud)

ios anchor-scroll ionic

7
推荐指数
1
解决办法
671
查看次数

ng-repeat angular中的shuffle数组

我正在创建一个测验,每次我开始测验时我想要改变问题,这样他们每次都不会出现在同一个顺序中.

我在我的HTML代码中有这个:

<div ng-repeat="question in questions | filter:ids | orderBy:randomSort">
    <div id="question">{{question.question}}</div><img id="nextImg" ng-src="../app/img/next.png" ng-click="next()" />
    <img class="quizImg" ng-hide="{{question.image}}==null" ng-src="{{question.image}}" />

    <div class="answer" ng-repeat="answer in question.answers">
        <input type="radio" ng-click="checked(answer)">{{answer.answer}}
    </div>
    <!--input id="nextQuestion" type="button" ng-click="next()" value="{{buttonText}}"-->
</div>
Run Code Online (Sandbox Code Playgroud)

这在我的控制器中

 lycheeControllers.controller('quizCtrl', ['$scope', '$http', function ($scope, $http) {
    $http.get('json/questions.json').success(function (data) {
        //all questions
        $scope.questions = data;

        $scope.titel = "Check your knowledge about lychees"


        $scope.randomSort = function(question) {
                      return Math.random();
                    };

        //filter for getting answers / question
        $scope.ids = function (question) {
            return question.id == …
Run Code Online (Sandbox Code Playgroud)

collections shuffle angularjs angularjs-ng-repeat

4
推荐指数
1
解决办法
2万
查看次数