TypeError:$(...)。toggleFullScreen不是函数,javascript.fullscreen没有加载

时间:2016-01-11 01:06:51

标签: javascript jquery angularjs

我正在使用this主题。默认主题对我有用然而解决方案我正在工作,全屏功能正在破碎。

<script src="js/plugins/fullscreen/jquery.fullscreen-min.js"></script>


TypeError: $(...).toggleFullScreen is not a function
    at Scope.$scope.toggleFullscreen (directives.js:484)
    at $parseFunctionCall (angular.js:12345)
    at callback (angular.js:21435)
    at Scope.$eval (angular.js:14401)
    at Scope.$apply (angular.js:14500)
    at HTMLButtonElement.<anonymous> (angular.js:21440)
    at HTMLButtonElement.n.event.dispatch (jquery-2.1.1.min.js:3)
    at HTMLButtonElement.r.handle (jquery-2.1.1.min.js:3)
function fullscreenMode() {
    return {
        restrict: 'A',
        template: '<button ng-click="toggleFullscreen()" type="button" class="btn btn-default expand" id="toggle-fullscreen"><i class="fa fa-expand"></i></button>',
        controller: function($scope, $element) {
            $scope.toggleFullscreen = function() {
                $(document).toggleFullScreen(); //breaking here
                $('#toggle-fullscreen .fa').toggleClass('fa-expand fa-compress');
            }
        }
    };
};

0 个答案:

没有答案