2
I have an element with two classes:
<div class="classe1 classe2">
</div>
I want to increase the width of my class 2 style, what would be the right way to do this?
2
I have an element with two classes:
<div class="classe1 classe2">
</div>
I want to increase the width of my class 2 style, what would be the right way to do this?
4
one of the correct ways to do this is to give the correct width to a new class, widthClass
(for example) and then make a ng-class
.
widthClass { width: 9000px }
<div ng-class="'widthClass': scope.needsMoreWidth" class="class1 class2"></div>
In your controller you’ll have something like:
$scope.needsMoreWidth = true;
2
If you want to apply width to all elements that apply class, in the case "classe2", at runtime, you can apply.
angular.element(".class2").width(500)
Browser other questions tagged javascript angularjs
You are not signed in. Login or sign up in order to post.
Wants to edit the
width
of the class or thediv
? If it is ofdiv
it would be simpler to edit the style. If you want to change thewidth
class even to affect all elements, maybe the best is to do override class.– Omni