0

I need to add the capability to change the return if window is resized. I don't know how to do it.

  $scope.widthLessParameter = function(parametro){
      if(!isNaN(parametro)){
        return $(window).width() - parametro + 'px';
      }else{
        return $(window).width() - $(parametro).width() + 'px';
      }
  }

Thanks a lot!

1
  • 1
    The question is not clear Commented Jul 16, 2014 at 22:32

2 Answers 2

1

You can listen to resize event changes.

angular.element($window).bind('resize', function () {
  console.log('window resized');
});
Sign up to request clarification or add additional context in comments.

Comments

0

Call this function from your HTML

like

<body onresize="widthLessParameter(parametro value)">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.