about.js 916 B

1234567891011121314151617181920212223242526
  1. app.directive('about',['$document',function($document){
  2. var link = function(scope, element, attr){
  3. var aboutItemArr = element[0].querySelectorAll('.about-item');
  4. var aboutItemArrJq = angular.element(aboutItemArr);
  5. for (let i = 0; i < aboutItemArrJq.length; i++) {
  6. let aboutItemJq = angular.element(aboutItemArrJq[i]);
  7. aboutItemJq.on('mouseover', function(){
  8. aboutItemJq.children()[0].style.transition = 'all 0.3s ease-in';
  9. aboutItemJq.children()[1].style.transition = 'all 0.3s 0.3s ease-out';
  10. })
  11. aboutItemJq.on('mouseout', function(){
  12. aboutItemJq.children()[0].style.transition = 'all 0.3s 0.3s ease-out';
  13. aboutItemJq.children()[1].style.transition = 'all 0.3s ease-in';
  14. })
  15. }
  16. }
  17. return {
  18. link: link,
  19. restrict: 'E',
  20. replace: true,
  21. templateUrl: 'app/views/about.html',
  22. controller: function($scope){
  23. }
  24. }
  25. }])