0

Please help rewrite the script without jquery.

here http://jsfiddle.net/xMUdA/ I made a slide-out panel. used angularjs and jquery.

it is necessary that was used only angularjs

js:

var app = angular.module("moduleSlidePanel", []);

app.controller("controllerSlidePanel", function ($scope, $timeout){

    // -------------------------------------------------------------------------------------------------- implementation ---------- 
    $scope.visible = function(){        
        $('.slide_panel').addClass('showPanel');
    };

    $scope.invisible = function(){      
        $('.slide_panel').removeClass('showPanel');
    };

    // -------------------------------------------------------------------------------------------------- initialization ---------- 

});
4

1 回答 1

0

就像这样:

<div class="slide_panel" ng-class="{'showPanel':show}">
    qwertyqwertyqwertyqwertyqwerty<br />
    qwertyqwertyqwertyqwertyqwerty<br />
    qwertyqwertyqwertyqwertyqwerty<br />
    qwertyqwertyqwertyqwertyqwerty<br />
    qwerty<br />
    qwerty<br />
    qwerty<br />
</div>

<div class="next" ng-click="show = true">show</div>
<br />
<br />
<div class="next" ng-click="show = false">hide</div>
于 2013-09-10T10:37:48.087 回答